com.sun.xml.internal.txw2.output.TXWSerializer Java Examples

The following examples show how to use com.sun.xml.internal.txw2.output.TXWSerializer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TXW.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * @param rootElement
 *      The {@link TypedXmlWriter} interface that declares the content model of the root element.
 *      This interface must have {@link XmlElement} annotation on it to designate the tag name
 *      of the root element.
 * @param out
 *      The target of the writing.
 */
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(rootElement);
    }

    Document doc = new Document(out);
    QName n = getTagName(rootElement);
    return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
}
 
Example #2
Source File: TXW.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * @param rootElement
 *      The {@link TypedXmlWriter} interface that declares the content model of the root element.
 *      This interface must have {@link XmlElement} annotation on it to designate the tag name
 *      of the root element.
 * @param out
 *      The target of the writing.
 */
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(rootElement);
    }

    Document doc = new Document(out);
    QName n = getTagName(rootElement);
    return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
}
 
Example #3
Source File: TXW.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * @param rootElement
 *      The {@link TypedXmlWriter} interface that declares the content model of the root element.
 *      This interface must have {@link XmlElement} annotation on it to designate the tag name
 *      of the root element.
 * @param out
 *      The target of the writing.
 */
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(rootElement);
    }

    Document doc = new Document(out);
    QName n = getTagName(rootElement);
    return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
}
 
Example #4
Source File: TXW.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * @param rootElement
 *      The {@link TypedXmlWriter} interface that declares the content model of the root element.
 *      This interface must have {@link XmlElement} annotation on it to designate the tag name
 *      of the root element.
 * @param out
 *      The target of the writing.
 */
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(rootElement);
    }

    Document doc = new Document(out);
    QName n = getTagName(rootElement);
    return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
}
 
Example #5
Source File: TXW.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * @param rootElement
 *      The {@link TypedXmlWriter} interface that declares the content model of the root element.
 *      This interface must have {@link XmlElement} annotation on it to designate the tag name
 *      of the root element.
 * @param out
 *      The target of the writing.
 */
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(rootElement);
    }

    Document doc = new Document(out);
    QName n = getTagName(rootElement);
    return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
}
 
Example #6
Source File: TXW.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * @param rootElement
 *      The {@link TypedXmlWriter} interface that declares the content model of the root element.
 *      This interface must have {@link XmlElement} annotation on it to designate the tag name
 *      of the root element.
 * @param out
 *      The target of the writing.
 */
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(rootElement);
    }

    Document doc = new Document(out);
    QName n = getTagName(rootElement);
    return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
}
 
Example #7
Source File: TXW.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * @param rootElement
 *      The {@link TypedXmlWriter} interface that declares the content model of the root element.
 *      This interface must have {@link XmlElement} annotation on it to designate the tag name
 *      of the root element.
 * @param out
 *      The target of the writing.
 */
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(rootElement);
    }

    Document doc = new Document(out);
    QName n = getTagName(rootElement);
    return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
}
 
Example #8
Source File: TXW.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * @param rootElement
 *      The {@link TypedXmlWriter} interface that declares the content model of the root element.
 *      This interface must have {@link XmlElement} annotation on it to designate the tag name
 *      of the root element.
 * @param out
 *      The target of the writing.
 */
public static <T extends TypedXmlWriter> T create( Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(rootElement);
    }

    Document doc = new Document(out);
    QName n = getTagName(rootElement);
    return new ContainerElement(doc,null,n.getNamespaceURI(),n.getLocalPart())._cast(rootElement);
}
 
Example #9
Source File: TXW.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * <p>
 * Similar to the other method, but this version allows the caller to set the
 * tag name at the run-time.
 *
 * @param tagName
 *      The tag name of the root document.
 *
 * @see #create(Class,XmlSerializer)
 */
public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(tagName,rootElement);
    }
    return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
}
 
Example #10
Source File: TXW.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * <p>
 * Similar to the other method, but this version allows the caller to set the
 * tag name at the run-time.
 *
 * @param tagName
 *      The tag name of the root document.
 *
 * @see #create(Class,XmlSerializer)
 */
public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(tagName,rootElement);
    }
    return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
}
 
Example #11
Source File: TXW.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * <p>
 * Similar to the other method, but this version allows the caller to set the
 * tag name at the run-time.
 *
 * @param tagName
 *      The tag name of the root document.
 *
 * @see #create(Class,XmlSerializer)
 */
public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(tagName,rootElement);
    }
    return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
}
 
Example #12
Source File: TXW.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * <p>
 * Similar to the other method, but this version allows the caller to set the
 * tag name at the run-time.
 *
 * @param tagName
 *      The tag name of the root document.
 *
 * @see #create(Class,XmlSerializer)
 */
public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(tagName,rootElement);
    }
    return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
}
 
Example #13
Source File: TXW.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * <p>
 * Similar to the other method, but this version allows the caller to set the
 * tag name at the run-time.
 *
 * @param tagName
 *      The tag name of the root document.
 *
 * @see #create(Class,XmlSerializer)
 */
public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(tagName,rootElement);
    }
    return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
}
 
Example #14
Source File: TXW.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * <p>
 * Similar to the other method, but this version allows the caller to set the
 * tag name at the run-time.
 *
 * @param tagName
 *      The tag name of the root document.
 *
 * @see #create(Class,XmlSerializer)
 */
public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(tagName,rootElement);
    }
    return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
}
 
Example #15
Source File: TXW.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * <p>
 * Similar to the other method, but this version allows the caller to set the
 * tag name at the run-time.
 *
 * @param tagName
 *      The tag name of the root document.
 *
 * @see #create(Class,XmlSerializer)
 */
public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(tagName,rootElement);
    }
    return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
}
 
Example #16
Source File: TXW.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a new {@link TypedXmlWriter} to write a new instance of a document.
 *
 * <p>
 * Similar to the other method, but this version allows the caller to set the
 * tag name at the run-time.
 *
 * @param tagName
 *      The tag name of the root document.
 *
 * @see #create(Class,XmlSerializer)
 */
public static <T extends TypedXmlWriter> T create( QName tagName, Class<T> rootElement, XmlSerializer out ) {
    if (out instanceof TXWSerializer) {
        TXWSerializer txws = (TXWSerializer) out;
        return txws.txw._element(tagName,rootElement);
    }
    return new ContainerElement(new Document(out),null,tagName.getNamespaceURI(),tagName.getLocalPart())._cast(rootElement);
}