public abstract class XMLMarshaller<ABSTRACT_SESSION extends CoreAbstractSession,CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,DESCRIPTOR extends Descriptor<?,?,?,?,?,?,?,?,?,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper,OBJECT_BUILDER extends ObjectBuilder<?,ABSTRACT_SESSION,?,XMLMarshaller>,SESSION extends CoreSession> extends Marshaller<CHARACTER_ESCAPE_HANDLER,CONTEXT,MARSHALLER_LISTENER,MEDIA_TYPE,NAMESPACE_PREFIX_MAPPER>
Marshaller.Listener
Constructor and Description |
---|
XMLMarshaller(CONTEXT context) |
Modifier and Type | Method and Description |
---|---|
XMLAttachmentMarshaller |
getAttachmentMarshaller() |
java.lang.String |
getAttributePrefix()
Value that will be used to prefix attributes.
|
DESCRIPTOR |
getDescriptor(java.lang.Object object)
INTERNAL:
Return the descriptor for the root object.
|
java.lang.Object |
getMarshalAttributeGroup() |
char |
getNamespaceSeparator()
Get the namespace separator used during marshal operations.
|
java.lang.String |
getNoNamespaceSchemaLocation()
Get the no namespace schema location set on this XMLMarshaller
|
javax.xml.validation.Schema |
getSchema() |
java.lang.String |
getSchemaLocation()
Get the schema location set on this XMLMarshaller
|
XMLTransformer |
getTransformer()
INTERNAL
|
java.lang.String |
getValueWrapper()
Name of the property to marshal/unmarshal as a wrapper on the text() mappings
Ignored marshalling XML.
|
java.lang.String |
getXmlHeader()
Get this Marshaller's XML Header.
|
boolean |
isApplicationJSON()
INTERNAL
|
boolean |
isApplicationXML()
INTERNAL
|
boolean |
isFragment()
PUBLIC:
Returns if this should marshal to a fragment.
|
boolean |
isIncludeRoot()
Determine if the @XMLRootElement should be marshalled when present.
|
boolean |
isMarshalEmptyCollections()
Name of the property to determine if empty collections should be marshalled as []
Ignored marshalling XML.
|
boolean |
isReduceAnyArrays()
Property to determine if size 1 any collections should be treated as collections
Ignored marshalling XML.
|
boolean |
isWrapperAsCollectionName() |
void |
marshal(java.lang.Object object,
org.xml.sax.ContentHandler contentHandler)
PUBLIC:
Convert the given object to XML and update the given contentHandler with that XML Document
|
void |
marshal(java.lang.Object object,
org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ext.LexicalHandler lexicalHandler)
PUBLIC:
Convert the given object to XML and update the given contentHandler with that XML Document
|
void |
marshal(java.lang.Object object,
MarshalRecord marshalRecord)
Convert the given object to XML and update the given marshal record with
that XML Document.
|
void |
marshal(java.lang.Object object,
org.w3c.dom.Node node)
PUBLIC:
|
void |
marshal(java.lang.Object object,
java.io.OutputStream outputStream)
PUBLIC:
Convert the given object to XML and update the given outputStream with that XML Document
|
void |
marshal(java.lang.Object object,
javax.xml.transform.Result result)
PUBLIC:
Convert the given object to XML and update the given result with that XML Document
|
void |
marshal(java.lang.Object object,
java.io.Writer writer)
PUBLIC:
Convert the given object to XML and update the given writer with that XML Document
|
org.w3c.dom.Document |
objectToXML(java.lang.Object object)
PUBLIC:
Convert the given object to an XML Document
|
void |
setAttachmentMarshaller(XMLAttachmentMarshaller atm) |
void |
setAttributePrefix(java.lang.String attributePrefix)
Value that will be used to prefix attributes.
|
void |
setEncoding(java.lang.String newEncoding)
Set the encoding on this XMLMarshaller
If the encoding is not set the default UTF-8 will be used
|
void |
setFormattedOutput(boolean shouldFormat)
Set if this XMLMarshaller should format the XML
By default this is set to true and the XML marshalled will be formatted.
|
void |
setFragment(boolean fragment)
PUBLIC:
Set if this should marshal to a fragment.
|
void |
setIncludeRoot(boolean includeRoot)
Determine if the @XMLRootElement should be marshalled when present.
|
void |
setMarshalAttributeGroup(java.lang.Object group) |
void |
setMarshalEmptyCollections(java.lang.Boolean marshalEmptyCollections)
Name of the property to determine if empty collections should be marshalled as []
Ignored marshalling XML.
|
void |
setMediaType(MEDIA_TYPE mediaType)
Set the MediaType for this xmlMarshaller.
|
void |
setNamespaceSeparator(char namespaceSeparator)
Set the namespace separator used during marshal operations.
|
void |
setNoNamespaceSchemaLocation(java.lang.String newNoNamespaceSchemaLocation)
Set the no namespace schema location on this XMLMarshaller
|
void |
setReduceAnyArrays(boolean reduceAnyArrays)
Property to determine if size 1 any collections should be treated as collections
Ignored marshalling XML.
|
void |
setSchema(javax.xml.validation.Schema schema) |
void |
setSchemaLocation(java.lang.String newSchemaLocation)
Set the schema location on this XMLMarshaller
|
void |
setValueWrapper(java.lang.String valueWrapper)
Name of the property to marshal/unmarshal as a wrapper on the text() mappings
Ignored marshalling XML.
|
void |
setWrapperAsCollectionName(boolean wrapperAsCollectionName) |
void |
setXmlHeader(java.lang.String xmlHeader)
Set this Marshaller's XML Header.
|
getCharacterEscapeHandler, getContext, getEncoding, getErrorHandler, getIndentString, getJsonTypeConfiguration, getMarshalListener, getNamespacePrefixMapper, getProperty, isEqualUsingIdenity, isFormattedOutput, setCharacterEscapeHandler, setEqualUsingIdenity, setErrorHandler, setIndentString, setMarshalListener, setNamespacePrefixMapper
public XMLMarshaller(CONTEXT context)
public XMLAttachmentMarshaller getAttachmentMarshaller()
getAttachmentMarshaller
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
public java.lang.String getAttributePrefix()
public DESCRIPTOR getDescriptor(java.lang.Object object) throws XMLMarshalException
XMLMarshalException
public java.lang.String getNoNamespaceSchemaLocation()
public javax.xml.validation.Schema getSchema()
public XMLTransformer getTransformer()
getTransformer
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
public java.lang.String getValueWrapper()
public java.lang.String getXmlHeader()
public java.lang.String getSchemaLocation()
public boolean isApplicationJSON()
isApplicationJSON
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
public boolean isApplicationXML()
isApplicationXML
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
public boolean isFragment()
public boolean isIncludeRoot()
isIncludeRoot
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
public boolean isReduceAnyArrays()
isReduceAnyArrays
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
public char getNamespaceSeparator()
public boolean isMarshalEmptyCollections()
public boolean isWrapperAsCollectionName()
isWrapperAsCollectionName
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
public void marshal(java.lang.Object object, org.xml.sax.ContentHandler contentHandler) throws XMLMarshalException
object
- the object to marshalcontentHandler
- the contentHandler which the specified object should be marshalled toXMLMarshalException
- if an error occurred during marshallingpublic void marshal(java.lang.Object object, org.xml.sax.ContentHandler contentHandler, org.xml.sax.ext.LexicalHandler lexicalHandler) throws XMLMarshalException
object
- the object to marshalcontentHandler
- the contentHandler which the specified object should be marshalled toXMLMarshalException
- if an error occurred during marshallingpublic void marshal(java.lang.Object object, MarshalRecord marshalRecord)
object
- the object to marshalmarshalRecord
- the marshalRecord to marshal the object topublic void marshal(java.lang.Object object, org.w3c.dom.Node node) throws XMLMarshalException
object
- the object to marshalnode
- the node which the specified object should be marshalled toXMLMarshalException
- if an error occurred during marshallingpublic void marshal(java.lang.Object object, java.io.OutputStream outputStream) throws XMLMarshalException
object
- the object to marshaloutputStream
- the outputStream to marshal the object toXMLMarshalException
- if an error occurred during marshallingpublic void marshal(java.lang.Object object, javax.xml.transform.Result result) throws XMLMarshalException
object
- the object to marshalresult
- the result to marshal the object toXMLMarshalException
- if an error occurred during marshallingpublic void marshal(java.lang.Object object, java.io.Writer writer) throws XMLMarshalException
object
- the object to marshalwriter
- the writer to marshal the object toXMLMarshalException
- if an error occurred during marshallingpublic org.w3c.dom.Document objectToXML(java.lang.Object object) throws XMLMarshalException
object
- the object to marshalXMLMarshalException
- if an error occurred during marshallingpublic void setAttachmentMarshaller(XMLAttachmentMarshaller atm)
public void setAttributePrefix(java.lang.String attributePrefix)
public void setEncoding(java.lang.String newEncoding)
setEncoding
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
newEncoding
- the encoding to set on this XMLMarshallerpublic void setFormattedOutput(boolean shouldFormat)
setFormattedOutput
in class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context<ABSTRACT_SESSION,DESCRIPTOR,?,?,?,SESSION,?>,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
shouldFormat
- if this XMLMarshaller should format the XMLpublic void setFragment(boolean fragment)
fragment
- if this should marshal to a fragment or notpublic void setIncludeRoot(boolean includeRoot)
public void setMarshalEmptyCollections(java.lang.Boolean marshalEmptyCollections)
public void setMediaType(MEDIA_TYPE mediaType)
mediaType
- public void setNamespaceSeparator(char namespaceSeparator)
public void setNoNamespaceSchemaLocation(java.lang.String newNoNamespaceSchemaLocation)
newNoNamespaceSchemaLocation
- no namespace schema location to be seton this XMLMarshallerpublic void setReduceAnyArrays(boolean reduceAnyArrays)
public void setSchema(javax.xml.validation.Schema schema)
public void setSchemaLocation(java.lang.String newSchemaLocation)
newSchemaLocation
- the schema location to be seton this XMLMarshallerpublic void setWrapperAsCollectionName(boolean wrapperAsCollectionName)
public void setValueWrapper(java.lang.String valueWrapper)
public void setXmlHeader(java.lang.String xmlHeader)
Set this Marshaller's XML Header. This header string will appear after the XML processing instruction (<?xml ...>), but before the start of the document's data.
This feature is only supported when marshalling to Stream, Writer, or StreamResult.
public void setMarshalAttributeGroup(java.lang.Object group)
public java.lang.Object getMarshalAttributeGroup()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference