aefimov@1443: /* aefimov@1443: * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. aefimov@1443: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aefimov@1443: * aefimov@1443: * This code is free software; you can redistribute it and/or modify it aefimov@1443: * under the terms of the GNU General Public License version 2 only, as aefimov@1443: * published by the Free Software Foundation. Oracle designates this aefimov@1443: * particular file as subject to the "Classpath" exception as provided aefimov@1443: * by Oracle in the LICENSE file that accompanied this code. aefimov@1443: * aefimov@1443: * This code is distributed in the hope that it will be useful, but WITHOUT aefimov@1443: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aefimov@1443: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aefimov@1443: * version 2 for more details (a copy is included in the LICENSE file that aefimov@1443: * accompanied this code). aefimov@1443: * aefimov@1443: * You should have received a copy of the GNU General Public License version aefimov@1443: * 2 along with this work; if not, write to the Free Software Foundation, aefimov@1443: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aefimov@1443: * aefimov@1443: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aefimov@1443: * or visit www.oracle.com if you need additional information or have any aefimov@1443: * questions. aefimov@1443: */ aefimov@1443: aefimov@1443: package com.sun.xml.internal.bind.marshaller; aefimov@1443: aefimov@1443: import java.io.IOException; aefimov@1443: import java.io.Writer; aefimov@1443: aefimov@1443: /** aefimov@1443: * Performs no character escaping. aefimov@1443: * aefimov@1443: * @author aefimov@1443: * Roman Grigoriadi (roman.grigoriadi@oracle.com) aefimov@1443: */ aefimov@1443: public class NoEscapeHandler implements CharacterEscapeHandler { aefimov@1443: aefimov@1443: public static final NoEscapeHandler theInstance = new NoEscapeHandler(); aefimov@1443: aefimov@1443: @Override aefimov@1443: public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException { aefimov@1443: out.write(ch, start, length); aefimov@1443: } aefimov@1443: }