Enum Class XmlFormat
- All Implemented Interfaces:
- Serializable,- Comparable<XmlFormat>,- Constable
See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionRender a bean property as an attribute instead of an element.Render property as attributes instead of an element.Prevents collections and arrays from being enclosed in<array> elements.Normal formatting (default).Render property as an element instead of an attribute.Render property value directly as the contents of the element.Same asELEMENTSexcept primitive types (string/boolean/number/null for example) are not wrapped in elements.Same asMIXED, but whitespace in text nodes are not trimmed during parsing.Render property value as the text content of the element.Same asTEXT, but whitespace in text node is not trimmed during parsing.Identifies a void element.Same asTEXTexcept the content is expected to be fully-formed XML that will get serialized as-is.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturnstrue if this format is one of those specified.static XmlFormatReturns the enum constant of this class with the specified name.static XmlFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
DEFAULT
- 
ATTRRender a bean property as an attribute instead of an element.Only applicable for bean properties, not bean classes. Can only be applied to properties (methods/fields) of class types that can be convertible to Strings .
- 
ATTRSRender property as attributes instead of an element.On a bean class, implies bean properties will be serialized as attributes instead of child elements by default. On bean properties, implies that the bean property value itself should be serialized as attributes on the bean element. The bean property data type must be of class type Map<Object,Object> where both objects are convertible toStrings .
- 
ELEMENTRender property as an element instead of an attribute.Only applicable for bean properties, not bean classes. Used to override the behavior of the ATTRSformat applied to the bean class.
- 
ELEMENTSRender property value directly as the contents of the element.On a bean class, implies that bean properties will be serialized as child elements. Note that this is equivalent to DEFAULT.Only applicable for objects of type array/Collection. On a bean property, implies that the bean property value itself should be serialized as child elements of the bean element. 
- 
MIXEDSame asELEMENTSexcept primitive types (string/boolean/number/null for example) are not wrapped in elements.Only applicable for bean properties, not bean classes. Only applicable for objects of type array/Collection. Use of this format may cause data type loss during parsing if the types cannot be inferred through reflection. 
- 
MIXED_PWSSame asMIXED, but whitespace in text nodes are not trimmed during parsing.An example use is HTML5 <pre> where whitespace should not be discarded.
- 
TEXTRender property value as the text content of the element.Similar to MIXEDbut value must be a single value, not a collection.Only applicable for bean properties, not bean classes. Use of this format may cause data type loss during parsing if the type cannot be inferred through reflection. 
- 
TEXT_PWSSame asTEXT, but whitespace in text node is not trimmed during parsing.
- 
XMLTEXTSame asTEXTexcept the content is expected to be fully-formed XML that will get serialized as-is.During parsing, this XML text will be re-serialized and set on the property. Only applicable for bean properties, not bean classes. Use of this format may cause data type loss during parsing if the type cannot be inferred through reflection. 
- 
COLLAPSEDPrevents collections and arrays from being enclosed in<array> elements.Can only be applied to properties (methods/fields) of type collection or array, or collection classes. 
- 
VOIDIdentifies a void element.Only applicable for bean classes. Identifies an element that never contains content. The main difference in behavior is how non-void empty elements are handled in the HTML serializer. Void elements are serialized as collapsed nodes (e.g. "<br/>" ) whereas non-void empty elements are serialized with an end tag (e.g. "<p></p>").
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
isOneOfReturnstrue if this format is one of those specified.- Parameters:
- formats- The formats to match against.
- Returns:
- true if this format is one of those specified.
 
 
-