Class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper>
- java.lang.Object
-
- org.eclipse.persistence.internal.oxm.Marshaller<CHARACTER_ESCAPE_HANDLER,CONTEXT,MARSHALLER_LISTENER,MEDIA_TYPE,NAMESPACE_PREFIX_MAPPER>
-
- Direct Known Subclasses:
XMLMarshaller
public abstract class Marshaller<CHARACTER_ESCAPE_HANDLER extends CharacterEscapeHandler,CONTEXT extends Context,MARSHALLER_LISTENER extends Marshaller.Listener,MEDIA_TYPE extends MediaType,NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Marshaller.Listener
An implementation of Marshaller.Listener can be set on an Marshaller to provide additional behaviour during marshal operations.
-
Field Summary
Fields Modifier and Type Field Description protected CONTEXT
context
protected NAMESPACE_PREFIX_MAPPER
mapper
protected java.util.Properties
marshalProperties
-
Constructor Summary
Constructors Modifier Constructor Description Marshaller(CONTEXT context)
protected
Marshaller(Marshaller marshaller)
Copy constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract XMLAttachmentMarshaller
getAttachmentMarshaller()
CHARACTER_ESCAPE_HANDLER
getCharacterEscapeHandler()
Return this Marshaller's CharacterEscapeHandler.CONTEXT
getContext()
Return the instance of Context that was used to create this instance of Marshaller.java.lang.String
getEncoding()
Get the encoding set on this Marshaller.org.xml.sax.ErrorHandler
getErrorHandler()
java.lang.String
getIndentString()
Return the String that will be used to perform indenting in marshalled documents.abstract JsonTypeConfiguration
getJsonTypeConfiguration()
Returns json type configuration.MARSHALLER_LISTENER
getMarshalListener()
NAMESPACE_PREFIX_MAPPER
getNamespacePrefixMapper()
NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data)java.lang.Object
getProperty(java.lang.Object key)
Return the property for a given key, if one exists.abstract XMLTransformer
getTransformer()
INTERNALabstract boolean
isApplicationJSON()
INTERNALabstract boolean
isApplicationXML()
INTERNALboolean
isEqualUsingIdenity()
INTERNALboolean
isFormattedOutput()
Returns if this Marshaller should format the output.abstract boolean
isIncludeRoot()
Determine if the root not should be marshalled.abstract boolean
isReduceAnyArrays()
Property to determine if size 1 any collections should be treated as collections.abstract boolean
isWrapperAsCollectionName()
void
setCharacterEscapeHandler(CHARACTER_ESCAPE_HANDLER c)
Set this Marshaller's CharacterEscapeHandler.void
setEncoding(java.lang.String newEncoding)
Set the encoding on this Marshaller.void
setEqualUsingIdenity(boolean equalUsingIdenity)
INTERNALvoid
setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
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
setIndentString(java.lang.String s)
Set the String that will be used to perform indenting in marshalled documents.void
setMarshalListener(MARSHALLER_LISTENER listener)
void
setNamespacePrefixMapper(NAMESPACE_PREFIX_MAPPER mapper)
NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data)
-
-
-
Field Detail
-
mapper
protected NAMESPACE_PREFIX_MAPPER extends NamespacePrefixMapper mapper
-
marshalProperties
protected java.util.Properties marshalProperties
-
-
Constructor Detail
-
Marshaller
public Marshaller(CONTEXT context)
-
Marshaller
protected Marshaller(Marshaller marshaller)
Copy constructor
-
-
Method Detail
-
getAttachmentMarshaller
public abstract XMLAttachmentMarshaller getAttachmentMarshaller()
-
getCharacterEscapeHandler
public CHARACTER_ESCAPE_HANDLER getCharacterEscapeHandler()
Return this Marshaller's CharacterEscapeHandler.- Since:
- 2.3.3
-
getContext
public CONTEXT getContext()
Return the instance of Context that was used to create this instance of Marshaller.
-
getEncoding
public java.lang.String getEncoding()
Get the encoding set on this Marshaller. If the encoding has not been set the default UTF-8 will be used
-
getErrorHandler
public org.xml.sax.ErrorHandler getErrorHandler()
-
getIndentString
public java.lang.String getIndentString()
Return the String that will be used to perform indenting in marshalled documents. Default is " " (three spaces).
-
getMarshalListener
public MARSHALLER_LISTENER getMarshalListener()
-
getNamespacePrefixMapper
public NAMESPACE_PREFIX_MAPPER getNamespacePrefixMapper()
NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data)
-
getProperty
public java.lang.Object getProperty(java.lang.Object key)
Return the property for a given key, if one exists.
-
getTransformer
public abstract XMLTransformer getTransformer()
INTERNAL- Returns:
- the transformer instance for this Marshaller
-
isApplicationJSON
public abstract boolean isApplicationJSON()
INTERNAL- Returns:
- true if the media type is application/json, else false.
- Since:
- EclipseLink 2.6.0
-
isApplicationXML
public abstract boolean isApplicationXML()
INTERNAL- Returns:
- true if the media type is application/xml, else false.
- Since:
- EclipseLink 2.6.0
-
isEqualUsingIdenity
public boolean isEqualUsingIdenity()
INTERNAL
-
isFormattedOutput
public boolean isFormattedOutput()
Returns if this Marshaller should format the output. By default this is set to true and the marshalled output will be formatted.- Returns:
- if this Marshaller should format the output
-
isIncludeRoot
public abstract boolean isIncludeRoot()
Determine if the root not should be marshalled. This property may ignored for media types that require a root node such as XML.
-
isReduceAnyArrays
public abstract boolean isReduceAnyArrays()
Property to determine if size 1 any collections should be treated as collections.
-
isWrapperAsCollectionName
public abstract boolean isWrapperAsCollectionName()
-
setCharacterEscapeHandler
public void setCharacterEscapeHandler(CHARACTER_ESCAPE_HANDLER c)
Set this Marshaller's CharacterEscapeHandler.- Since:
- 2.3.3
-
setEncoding
public void setEncoding(java.lang.String newEncoding)
Set the encoding on this Marshaller. If the encoding is not set the default UTF-8 will be used.- Parameters:
newEncoding
- the encoding to set on this Marshaller
-
setEqualUsingIdenity
public void setEqualUsingIdenity(boolean equalUsingIdenity)
INTERNAL
-
setErrorHandler
public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
-
setFormattedOutput
public 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.- Parameters:
shouldFormat
- if this XMLMarshaller should format the XML
-
setIndentString
public void setIndentString(java.lang.String s)
Set the String that will be used to perform indenting in marshalled documents.- Since:
- 2.3.3
-
setMarshalListener
public void setMarshalListener(MARSHALLER_LISTENER listener)
-
setNamespacePrefixMapper
public void setNamespacePrefixMapper(NAMESPACE_PREFIX_MAPPER mapper)
NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data)
-
getJsonTypeConfiguration
public abstract JsonTypeConfiguration getJsonTypeConfiguration()
Returns json type configuration.- Returns:
- json type configuration
- Since:
- 2.6.0
-
-