@ThreadSafe public final class JAXBBuilderDefaultSettings extends Object
JAXBReaderBuilder, JAXBValidationBuilder and
JAXBWriterBuilder use the settings in this class as the defaults.| Modifier and Type | Field and Description |
|---|---|
static Charset |
DEFAULT_CHARSET |
static boolean |
DEFAULT_FORMATTED_OUTPUT |
static boolean |
DEFAULT_USE_CONTEXT_CACHE |
| Modifier and Type | Method and Description |
|---|---|
static Charset |
getDefaultCharset() |
static String |
getDefaultIndentString() |
static NamespaceContext |
getDefaultNamespaceContext() |
static String |
getDefaultNoNamespaceSchemaLocation() |
static String |
getDefaultSchemaLocation() |
static ValidationEventHandler |
getDefaultValidationEventHandler() |
static boolean |
isDefaultFormattedOutput() |
static boolean |
isDefaultUseContextCache() |
static void |
setDefaultCharset(Charset aCharset)
Set the default charset to be used for writing JAXB objects.
|
static void |
setDefaultFormattedOutput(boolean bFormattedOutput)
Enable or disable the formatting of the output.
|
static void |
setDefaultIndentString(String sIndentString)
Set the default indent string to be used for writing JAXB objects.
|
static void |
setDefaultNamespaceContext(NamespaceContext aNamespaceContext)
Set the default namespace context (prefix to namespace URL mapping) to be
used.
|
static void |
setDefaultNoNamespaceSchemaLocation(String sNoNamespaceSchemaLocation)
Set the no namespace schema location to be used for writing JAXB objects.
|
static void |
setDefaultSchemaLocation(String sSchemaLocation)
Set the schema location to be used for writing JAXB objects.
|
static void |
setDefaultUseContextCache(boolean bUseContextCache)
Enable or disable the usage of the JAXBContext cache.
|
static void |
setDefaultValidationEventHandler(ValidationEventHandler aEventHandler)
Set a global event handler that should be passed to all read/write actions.
|
public static final boolean DEFAULT_USE_CONTEXT_CACHE
public static final boolean DEFAULT_FORMATTED_OUTPUT
public static final Charset DEFAULT_CHARSET
public static void setDefaultUseContextCache(boolean bUseContextCache)
bUseContextCache - true to enable it, false to disable it.public static boolean isDefaultUseContextCache()
true if the JAXBContext cache should be used. Default
is true.public static void setDefaultValidationEventHandler(@Nullable ValidationEventHandler aEventHandler)
aEventHandler - The new default event handler. May be null to indicate,
that the default handler should be used.@Nullable public static ValidationEventHandler getDefaultValidationEventHandler()
null to indicate that no global validation event
handler is defined, and the default validation handler is used.public static void setDefaultNamespaceContext(@Nullable NamespaceContext aNamespaceContext)
aNamespaceContext - The namespace context to be used by default. May be
null.@Nullable public static NamespaceContext getDefaultNamespaceContext()
null by
default.public static void setDefaultFormattedOutput(boolean bFormattedOutput)
bFormattedOutput - true to enable it, false to disable it.public static boolean isDefaultFormattedOutput()
true if the JAXB output should be formatted. Only for
writers. Default is false. The JDK implementation does
not format by default.public static void setDefaultCharset(@Nullable Charset aCharset)
aCharset - The charset to be used by default. May be null.@Nullable public static Charset getDefaultCharset()
null
by default. The JDK implementation uses UTF-8 by default.public static void setDefaultIndentString(@Nullable String sIndentString)
sIndentString - The indent string to be used by default. May be null.@Nullable public static String getDefaultIndentString()
null by default. Only used when formatted output is
used. The JDK implementation uses 4 spaces by default.public static void setDefaultSchemaLocation(@Nullable String sSchemaLocation)
sSchemaLocation - The schema location to be used by default. May be null.@Nullable public static String getDefaultSchemaLocation()
null
by default.public static void setDefaultNoNamespaceSchemaLocation(@Nullable String sNoNamespaceSchemaLocation)
sNoNamespaceSchemaLocation - The no namespace schema location to be used by default. May be
null.Copyright © 2015–2021 Philip Helger. All rights reserved.