@Immutable public final class JAXBMarshallerUtils extends Object
Marshaller objects. It
allows for setting type-safe properties.| Modifier and Type | Method and Description |
|---|---|
static String |
getEncoding(Marshaller aMarshaller) |
static String |
getNoNamespaceSchemaLocation(Marshaller aMarshaller) |
static String |
getSchemaLocation(Marshaller aMarshaller) |
static Object |
getSunCharacterEscapeHandler(Marshaller aMarshaller) |
static String |
getSunIndentString(Marshaller aMarshaller) |
static Object |
getSunNamespacePrefixMapper(Marshaller aMarshaller) |
static String |
getSunXMLHeaders(Marshaller aMarshaller) |
static boolean |
isExternalSunJAXB2Marshaller(Marshaller aMarshaller)
Check if the passed marshaller is external to the one contained in the
runtime.
|
static boolean |
isFormattedOutput(Marshaller aMarshaller) |
static boolean |
isFragment(Marshaller aMarshaller) |
static boolean |
isInternalSunJAXB2Marshaller(Marshaller aMarshaller)
Check if the passed marshaller is an internal one contained in the runtime.
|
static boolean |
isSunCanonicalization(Marshaller aMarshaller) |
static boolean |
isSunJAXB2Marshaller(Marshaller aMarshaller)
Check if the passed Marshaller is a Sun JAXB v2 marshaller.
|
static boolean |
isSunObjectIdentityCycleDetection(Marshaller aMarshaller) |
static void |
setEncoding(Marshaller aMarshaller,
Charset aEncoding)
Set the standard property for the encoding charset.
|
static void |
setEncoding(Marshaller aMarshaller,
String sEncoding)
Set the standard property for the encoding charset.
|
static void |
setFormattedOutput(Marshaller aMarshaller,
boolean bFormattedOutput)
Set the standard property for formatting the output or not.
|
static void |
setFragment(Marshaller aMarshaller,
boolean bFragment)
Set the standard property for marshalling a fragment only.
|
static void |
setNoNamespaceSchemaLocation(Marshaller aMarshaller,
String sSchemaLocation)
Set the standard property for setting the no-namespace schema location
|
static void |
setSchemaLocation(Marshaller aMarshaller,
String sSchemaLocation)
Set the standard property for setting the namespace schema location
|
static void |
setSunCanonicalization(Marshaller aMarshaller,
boolean bCanonicalize)
Set the Sun specific canonicalization property.
|
static void |
setSunCharacterEscapeHandler(Marshaller aMarshaller,
Object aCharacterEscapeHandler)
Set the Sun specific encoding handler.
|
static void |
setSunIndentString(Marshaller aMarshaller,
String sIndentString)
Set the Sun specific property for the indent string.
|
static void |
setSunNamespacePrefixMapper(Marshaller aMarshaller,
Object aNamespacePrefixMapper)
Set the Sun specific namespace prefix mapper.
|
static void |
setSunObjectIdentityCycleDetection(Marshaller aMarshaller,
boolean bObjectIdentityCycleDetection)
Set the Sun specific canonicalization property.
|
static void |
setSunXMLHeaders(Marshaller aMarshaller,
String sXMLHeaders)
Set the Sun specific XML header string.
|
public static void setEncoding(@Nonnull Marshaller aMarshaller, @Nullable Charset aEncoding)
aMarshaller - The marshaller to set the property. May not be null.aEncoding - the value to be setpublic static void setEncoding(@Nonnull Marshaller aMarshaller, @Nullable String sEncoding)
aMarshaller - The marshaller to set the property. May not be null.sEncoding - the value to be setpublic static String getEncoding(@Nonnull Marshaller aMarshaller)
public static void setFormattedOutput(@Nonnull Marshaller aMarshaller, boolean bFormattedOutput)
aMarshaller - The marshaller to set the property. May not be null.bFormattedOutput - the value to be setpublic static boolean isFormattedOutput(@Nonnull Marshaller aMarshaller)
public static void setSchemaLocation(@Nonnull Marshaller aMarshaller, @Nullable String sSchemaLocation)
aMarshaller - The marshaller to set the property. May not be null.sSchemaLocation - the value to be setpublic static String getSchemaLocation(@Nonnull Marshaller aMarshaller)
public static void setNoNamespaceSchemaLocation(@Nonnull Marshaller aMarshaller, @Nullable String sSchemaLocation)
aMarshaller - The marshaller to set the property. May not be null.sSchemaLocation - the value to be setpublic static String getNoNamespaceSchemaLocation(@Nonnull Marshaller aMarshaller)
public static void setFragment(@Nonnull Marshaller aMarshaller, boolean bFragment)
aMarshaller - The marshaller to set the property. May not be null.bFragment - the value to be setpublic static boolean isFragment(@Nonnull Marshaller aMarshaller)
public static void setSunIndentString(@Nonnull Marshaller aMarshaller, @Nullable String sIndentString)
aMarshaller - The marshaller to set the property. May not be null.sIndentString - the value to be setpublic static String getSunIndentString(@Nonnull Marshaller aMarshaller)
public static void setSunCharacterEscapeHandler(@Nonnull Marshaller aMarshaller, @Nonnull Object aCharacterEscapeHandler)
aMarshaller - The marshaller to set the property. May not be null.aCharacterEscapeHandler - the value to be setpublic static Object getSunCharacterEscapeHandler(@Nonnull Marshaller aMarshaller)
public static void setSunNamespacePrefixMapper(@Nonnull Marshaller aMarshaller, @Nonnull Object aNamespacePrefixMapper)
aMarshaller - The marshaller to set the property. May not be null.aNamespacePrefixMapper - the value to be setisExternalSunJAXB2Marshaller(Marshaller),
isInternalSunJAXB2Marshaller(Marshaller)public static Object getSunNamespacePrefixMapper(@Nonnull Marshaller aMarshaller)
public static void setSunXMLHeaders(@Nonnull Marshaller aMarshaller, @Nonnull String sXMLHeaders)
aMarshaller - The marshaller to set the property. May not be null.sXMLHeaders - the value to be setpublic static String getSunXMLHeaders(@Nonnull Marshaller aMarshaller)
public static void setSunCanonicalization(@Nonnull Marshaller aMarshaller, boolean bCanonicalize)
aMarshaller - The marshaller to set the property. May not be null.bCanonicalize - the value to be setpublic static boolean isSunCanonicalization(@Nonnull Marshaller aMarshaller)
public static void setSunObjectIdentityCycleDetection(@Nonnull Marshaller aMarshaller, boolean bObjectIdentityCycleDetection)
aMarshaller - The marshaller to set the property. May not be null.bObjectIdentityCycleDetection - the value to be setpublic static boolean isSunObjectIdentityCycleDetection(@Nonnull Marshaller aMarshaller)
public static boolean isSunJAXB2Marshaller(@Nullable Marshaller aMarshaller)
aMarshaller - The marshaller to be checked. May be null.true if the passed marshaller is not null
and is of the Sun class.public static boolean isExternalSunJAXB2Marshaller(@Nullable Marshaller aMarshaller)
aMarshaller - The marshaller to check. May be null.true if it is a JAXB marshaller from an external
package (e.g. by having jaxb-impl in the dependencies)public static boolean isInternalSunJAXB2Marshaller(@Nullable Marshaller aMarshaller)
aMarshaller - The marshaller to check. May be null.true if it is a JAXB marshaller from the runtime
library packageCopyright © 2006–2015 phloc systems. All rights reserved.