public enum Xml2BeanOptions extends Enum<Xml2BeanOptions>
Xml2BeanConverter
to control the way that DOM trees
are translated to Java beans.Enum Constant and Description |
---|
BYTE_ARRAYS_AS_BASE64
Expects byte arrays as a Base64-encoded string
|
BYTE_ARRAYS_AS_HEX
Outputs byte arrays as a hex-encoded string
|
CACHE_INTROSPECTIONS
Will use a shared static introspection cache for all conversions.
|
CONVERT_ATTRIBUTES
Will attempt to convert attribute values as well as elements.
|
CONVERT_ATTRIBUTES_MATCH_NAMESPACE
Will attempt to convert attribute values as well as elements, ignoring
all attributes that do not have the same namespace as the element they
belong to (includes null namespaces).
|
DEFER_EXCEPTIONS
Defer exception processing.
|
EMPTY_IS_NULL
If present, the converter will treat all elements with empty text nodes
as if they were empty elements -- in other words,
null . |
ENUM_AS_STRING_VALUE
Match enums by their
toString() values. |
EXPECT_XSD_FORMAT
Expect data (in particular, dates and booleans) to be formatted per XML Schema
specifications.
|
IGNORE_MISSING_PROPERTIES
If present, the converter ignores elements that don't correspond to
settable properties of the bean.
|
REQUIRE_TYPE
If present, the converter requires a
type attribute on
each element, and will use that attribute to verify that the element
can be converted to the desired type. |
REQUIRE_XSI_NIL
If present, the converter requires an
xsi:nil attribute
on any empty nodes, and will throw if it's not present. |
Modifier and Type | Method and Description |
---|---|
static Xml2BeanOptions |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Xml2BeanOptions[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Xml2BeanOptions BYTE_ARRAYS_AS_BASE64
public static final Xml2BeanOptions BYTE_ARRAYS_AS_HEX
public static final Xml2BeanOptions CACHE_INTROSPECTIONS
Warning: if you use this option, do not store this library in a shared app-server classpath. If you do, the cache will prevent class unloading, and you will run out of permgen space.
public static final Xml2BeanOptions CONVERT_ATTRIBUTES
Child elements will be converted after attributes; if an element has the same name as an attribute, the element value takes precedence.
public static final Xml2BeanOptions CONVERT_ATTRIBUTES_MATCH_NAMESPACE
Child elements will be converted after attributes; if an element has the same name as an attribute, the element value takes precedence.
public static final Xml2BeanOptions DEFER_EXCEPTIONS
Note: all deferred exceptions will be of type
ConversionException
, and will wrap
an underlying cause. Because the converter works by reflection, in many
cases this cause will be an InvocationTargetException
with
its own cause.
public static final Xml2BeanOptions EMPTY_IS_NULL
null
.
Note that this flag will interact with REQUIRE_XSI_NIL
.public static final Xml2BeanOptions ENUM_AS_STRING_VALUE
toString()
values. By default, enums are
matched by name (which is also the default string value).public static final Xml2BeanOptions EXPECT_XSD_FORMAT
public static final Xml2BeanOptions IGNORE_MISSING_PROPERTIES
public static final Xml2BeanOptions REQUIRE_TYPE
type
attribute on
each element, and will use that attribute to verify that the element
can be converted to the desired type.public static final Xml2BeanOptions REQUIRE_XSI_NIL
xsi:nil
attribute
on any empty nodes, and will throw if it's not present. Default is to
treat empty nodes as null
.public static Xml2BeanOptions[] values()
for (Xml2BeanOptions c : Xml2BeanOptions.values()) System.out.println(c);
public static Xml2BeanOptions valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null