Sun, 18 Jun 2017 23:18:45 +0100
8172297: In java 8, the marshalling with JAX-WS does not escape carriage return
Reviewed-by: lancea
aefimov@1443 | 1 | /* |
aefimov@1443 | 2 | * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
aefimov@1443 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aefimov@1443 | 4 | * |
aefimov@1443 | 5 | * This code is free software; you can redistribute it and/or modify it |
aefimov@1443 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aefimov@1443 | 7 | * published by the Free Software Foundation. Oracle designates this |
aefimov@1443 | 8 | * particular file as subject to the "Classpath" exception as provided |
aefimov@1443 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
aefimov@1443 | 10 | * |
aefimov@1443 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aefimov@1443 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aefimov@1443 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aefimov@1443 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
aefimov@1443 | 15 | * accompanied this code). |
aefimov@1443 | 16 | * |
aefimov@1443 | 17 | * You should have received a copy of the GNU General Public License version |
aefimov@1443 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
aefimov@1443 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aefimov@1443 | 20 | * |
aefimov@1443 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aefimov@1443 | 22 | * or visit www.oracle.com if you need additional information or have any |
aefimov@1443 | 23 | * questions. |
aefimov@1443 | 24 | */ |
aefimov@1443 | 25 | |
aefimov@1443 | 26 | package com.sun.xml.internal.bind.marshaller; |
aefimov@1443 | 27 | |
aefimov@1443 | 28 | import java.io.IOException; |
aefimov@1443 | 29 | import java.io.Writer; |
aefimov@1443 | 30 | |
aefimov@1443 | 31 | /** |
aefimov@1443 | 32 | * Performs no character escaping. |
aefimov@1443 | 33 | * |
aefimov@1443 | 34 | * @author |
aefimov@1443 | 35 | * Roman Grigoriadi (roman.grigoriadi@oracle.com) |
aefimov@1443 | 36 | */ |
aefimov@1443 | 37 | public class NoEscapeHandler implements CharacterEscapeHandler { |
aefimov@1443 | 38 | |
aefimov@1443 | 39 | public static final NoEscapeHandler theInstance = new NoEscapeHandler(); |
aefimov@1443 | 40 | |
aefimov@1443 | 41 | @Override |
aefimov@1443 | 42 | public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException { |
aefimov@1443 | 43 | out.write(ch, start, length); |
aefimov@1443 | 44 | } |
aefimov@1443 | 45 | } |