Search in sources :

Example 1 with CharacterEscapeHandler

use of com.sun.xml.bind.marshaller.CharacterEscapeHandler in project OpenAM by OpenRock.

the class MarshallerImpl method createWriter.

public XMLWriter createWriter(Writer w, String encoding) throws JAXBException {
    // buffering improves the performance
    w = new BufferedWriter(w);
    CharacterEscapeHandler ceh = createEscapeHandler(encoding);
    XMLWriter xw;
    if (isFormattedOutput()) {
        DataWriter d = new DataWriter(w, encoding, ceh);
        d.setIndentStep(indent);
        xw = d;
    } else
        xw = new XMLWriter(w, encoding, ceh);
    xw.setXmlDecl(printXmlDeclaration);
    xw.setHeader(header);
    return xw;
}
Also used : CharacterEscapeHandler(com.sun.xml.bind.marshaller.CharacterEscapeHandler) XMLWriter(com.sun.xml.bind.marshaller.XMLWriter) BufferedWriter(java.io.BufferedWriter) DataWriter(com.sun.xml.bind.marshaller.DataWriter)

Example 2 with CharacterEscapeHandler

use of com.sun.xml.bind.marshaller.CharacterEscapeHandler in project Payara by payara.

the class MarshallerImpl method createWriter.

public XMLWriter createWriter(Writer w, String encoding) throws JAXBException {
    // buffering improves the performance
    w = new BufferedWriter(w);
    CharacterEscapeHandler ceh = createEscapeHandler(encoding);
    XMLWriter xw;
    if (isFormattedOutput()) {
        DataWriter d = new DataWriter(w, encoding, ceh);
        d.setIndentStep(indent);
        xw = d;
    } else
        xw = new XMLWriter(w, encoding, ceh);
    xw.setXmlDecl(printXmlDeclaration);
    xw.setHeader(header);
    return xw;
}
Also used : CharacterEscapeHandler(com.sun.xml.bind.marshaller.CharacterEscapeHandler) XMLWriter(com.sun.xml.bind.marshaller.XMLWriter) BufferedWriter(java.io.BufferedWriter) DataWriter(com.sun.xml.bind.marshaller.DataWriter)

Example 3 with CharacterEscapeHandler

use of com.sun.xml.bind.marshaller.CharacterEscapeHandler in project OpenAM by OpenRock.

the class MarshallerImpl method createWriter.

public XMLWriter createWriter(Writer w, String encoding) throws JAXBException {
    // buffering improves the performance
    w = new BufferedWriter(w);
    CharacterEscapeHandler ceh = createEscapeHandler(encoding);
    XMLWriter xw;
    if (isFormattedOutput()) {
        DataWriter d = new DataWriter(w, encoding, ceh);
        d.setIndentStep(indent);
        xw = d;
    } else
        xw = new XMLWriter(w, encoding, ceh);
    xw.setXmlDecl(printXmlDeclaration);
    xw.setHeader(header);
    return xw;
}
Also used : CharacterEscapeHandler(com.sun.xml.bind.marshaller.CharacterEscapeHandler) XMLWriter(com.sun.xml.bind.marshaller.XMLWriter) BufferedWriter(java.io.BufferedWriter) DataWriter(com.sun.xml.bind.marshaller.DataWriter)

Example 4 with CharacterEscapeHandler

use of com.sun.xml.bind.marshaller.CharacterEscapeHandler in project OpenAM by OpenRock.

the class MarshallerImpl method createWriter.

public XMLWriter createWriter(Writer w, String encoding) throws JAXBException {
    // buffering improves the performance
    w = new BufferedWriter(w);
    CharacterEscapeHandler ceh = createEscapeHandler(encoding);
    XMLWriter xw;
    if (isFormattedOutput()) {
        DataWriter d = new DataWriter(w, encoding, ceh);
        d.setIndentStep(indent);
        xw = d;
    } else
        xw = new XMLWriter(w, encoding, ceh);
    xw.setXmlDecl(printXmlDeclaration);
    xw.setHeader(header);
    return xw;
}
Also used : CharacterEscapeHandler(com.sun.xml.bind.marshaller.CharacterEscapeHandler) XMLWriter(com.sun.xml.bind.marshaller.XMLWriter) BufferedWriter(java.io.BufferedWriter) DataWriter(com.sun.xml.bind.marshaller.DataWriter)

Example 5 with CharacterEscapeHandler

use of com.sun.xml.bind.marshaller.CharacterEscapeHandler in project OpenAM by OpenRock.

the class MarshallerImpl method createWriter.

public XMLWriter createWriter(Writer w, String encoding) throws JAXBException {
    // buffering improves the performance
    w = new BufferedWriter(w);
    CharacterEscapeHandler ceh = createEscapeHandler(encoding);
    XMLWriter xw;
    if (isFormattedOutput()) {
        DataWriter d = new DataWriter(w, encoding, ceh);
        d.setIndentStep(indent);
        xw = d;
    } else
        xw = new XMLWriter(w, encoding, ceh);
    xw.setXmlDecl(printXmlDeclaration);
    xw.setHeader(header);
    return xw;
}
Also used : CharacterEscapeHandler(com.sun.xml.bind.marshaller.CharacterEscapeHandler) XMLWriter(com.sun.xml.bind.marshaller.XMLWriter) BufferedWriter(java.io.BufferedWriter) DataWriter(com.sun.xml.bind.marshaller.DataWriter)

Aggregations

CharacterEscapeHandler (com.sun.xml.bind.marshaller.CharacterEscapeHandler)7 DataWriter (com.sun.xml.bind.marshaller.DataWriter)5 XMLWriter (com.sun.xml.bind.marshaller.XMLWriter)5 BufferedWriter (java.io.BufferedWriter)5 Escaper (com.google.common.escape.Escaper)1 IOException (java.io.IOException)1 Writer (java.io.Writer)1 JAXBContext (javax.xml.bind.JAXBContext)1 JAXBException (javax.xml.bind.JAXBException)1 Marshaller (javax.xml.bind.Marshaller)1