Top Description Constructors Methods
com.sun.xml.txw2

public abstract Class TXW

extends Object
Class Inheritance
Imports
com.sun.xml.txw2.output.XmlSerializer, .TXWSerializer, com.sun.xml.txw2.annotation.XmlElement, .XmlNamespace, javax.xml.namespace.QName

Entry point to TXW.
Author
Kohsuke Kawaguchi

Constructor Summary

AccessConstructor and Description
private
TXW()

Method Summary

Modifier and TypeMethod and Description
public static <
an instance of TypedXmlWriter
T extends TypedXmlWriter
>
T

Returns:

always return non-null TypedXmlWriter that can be used to write the contents of the root element.
create
(Class<T>
The TypedXmlWriter interface that declares the content model of the root element. This interface must have XmlElement annotation on it to designate the tag name of the root element.
rootElement
,
XmlSerializer
The target of the writing.
out
)

Creates a new TypedXmlWriter to write a new instance of a document.

public static <
an instance of TypedXmlWriter
T extends TypedXmlWriter
>
T

Returns:

always return non-null TypedXmlWriter that can be used to write the contents of the root element.
create
(QName
The tag name of the root document.
tagName
,
Class<T>
The TypedXmlWriter interface that declares the content model of the root element. This interface must have XmlElement annotation on it to designate the tag name of the root element.
rootElement
,
XmlSerializer
The target of the writing.
out
)

Creates a new TypedXmlWriter to write a new instance of a document.

pack-priv static QName
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TXWback to summary
private TXW()

Method Detail

createback to summary
public static <T extends TypedXmlWriter> T create(Class<T> rootElement, XmlSerializer out)

Creates a new TypedXmlWriter to write a new instance of a document.

Parameters
<T>
an instance of TypedXmlWriter
rootElement:Class<T>

The TypedXmlWriter interface that declares the content model of the root element. This interface must have XmlElement annotation on it to designate the tag name of the root element.

out:XmlSerializer

The target of the writing.

Returns:T

always return non-null TypedXmlWriter that can be used to write the contents of the root element.

createback to summary
public static <T extends TypedXmlWriter> T create(QName tagName, Class<T> rootElement, XmlSerializer out)

Creates a new TypedXmlWriter to write a new instance of a document.

Similar to the other method, but this version allows the caller to set the tag name at the run-time.

Parameters
<T>
an instance of TypedXmlWriter
tagName:QName

The tag name of the root document.

rootElement:Class<T>

The TypedXmlWriter interface that declares the content model of the root element. This interface must have XmlElement annotation on it to designate the tag name of the root element.

out:XmlSerializer

The target of the writing.

Returns:T

always return non-null TypedXmlWriter that can be used to write the contents of the root element.

See Also
create(Class, XmlSerializer)
getTagNameback to summary
pack-priv static QName getTagName(Class<?> c)