org.eclipse.persistence.internal.oxm.CharacterEscapeHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eclipselink Show documentation
Show all versions of eclipselink Show documentation
EclipseLink build based upon Git transaction f2b9fc5
/*
* Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
// Contributors:
// Blaise Doughan - 2.6 - initial implementation
package org.eclipse.persistence.internal.oxm;
import java.io.IOException;
import java.io.Writer;
/**
*
* Provide an interface to allow for custom character escaping behaviour.
*
*/
public interface CharacterEscapeHandler {
/**
*
* Perform character escaping and write the result to the output.
*
*
*
* Note: This feature is not supported when marshalling to the following targets:
*
* - javax.xml.stream.XMLStreamWriter
* - javax.xml.stream.XMLEventWriter
* - org.xml.sax.ContentHandler
* - org.w3c.dom.Node
*
*
*
* @param buffer Array of characters to be escaped
* @param start The starting position
* @param length The number of characters being escaped
* @param isAttributeValue A value of 'true' indicates this is an attribute value
* @param out The resulting escaped characters will be written to this Writer
* @throws IOException In an error condition, IOException can be thrown to stop the marshalling process
*/
public void escape(char[] buffer, int start, int length, boolean isAttributeValue, Writer out) throws IOException;
}