Module org.eclipse.persistence.core
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 Object
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
An implementation of Marshaller.Listener can be set on an Marshaller to provide additional behaviour during marshal operations. -
Field Summary
Modifier and TypeFieldDescriptionprotected CONTEXT
protected NAMESPACE_PREFIX_MAPPER
protected Properties
-
Constructor Summary
ModifierConstructorDescriptionprotected
Marshaller
(CONTEXT context) protected
Marshaller
(Marshaller marshaller) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionabstract XMLAttachmentMarshaller
Return this Marshaller's CharacterEscapeHandler.Return the instance of Context that was used to create this instance of Marshaller.Get the encoding set on this Marshaller.Return the String that will be used to perform indenting in marshalled documents.abstract JsonTypeConfiguration
Returns json type configuration.NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data)getProperty
(Object key) Return the property for a given key, if one exists.abstract XMLTransformer
INTERNALabstract boolean
INTERNALabstract boolean
INTERNALboolean
INTERNALboolean
Returns if this Marshaller should format the output.abstract boolean
Determine if the root not should be marshalled.abstract boolean
Property to determine if size 1 any collections should be treated as collections.abstract boolean
void
Set this Marshaller's CharacterEscapeHandler.void
setEncoding
(String newEncoding) Set the encoding on this Marshaller.void
setEqualUsingIdenity
(boolean equalUsingIdenity) INTERNALvoid
setErrorHandler
(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
Set the String that will be used to perform indenting in marshalled documents.void
setMarshalListener
(MARSHALLER_LISTENER listener) void
NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data)
-
Field Details
-
context
-
mapper
-
marshalProperties
-
-
Constructor Details
-
Marshaller
-
Marshaller
Copy constructor
-
-
Method Details
-
getAttachmentMarshaller
-
getCharacterEscapeHandler
Return this Marshaller's CharacterEscapeHandler.- Since:
- 2.3.3
-
getContext
Return the instance of Context that was used to create this instance of Marshaller. -
getEncoding
Get the encoding set on this Marshaller. If the encoding has not been set the default UTF-8 will be used -
getErrorHandler
-
getIndentString
Return the String that will be used to perform indenting in marshalled documents. Default is " " (three spaces). -
getMarshalListener
-
getNamespacePrefixMapper
NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data) -
getProperty
Return the property for a given key, if one exists. -
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
Set this Marshaller's CharacterEscapeHandler.- Since:
- 2.3.3
-
setEncoding
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
-
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
Set the String that will be used to perform indenting in marshalled documents.- Since:
- 2.3.3
-
setMarshalListener
-
setNamespacePrefixMapper
NamespacePrefixMapper that can be used during marshal (instead of those set in the project meta data) -
getJsonTypeConfiguration
Returns json type configuration.- Returns:
- json type configuration
- Since:
- 2.6.0
-