public class Bean2XmlConverter extends Object
Note: this class is intended to convert simple data transfer beans, using those objects' public getters and setters.
Constructor and Description |
---|
Bean2XmlConverter(Bean2XmlOptions... options) |
Modifier and Type | Method and Description |
---|---|
Element |
convert(Object obj,
String rootName)
Creates an XML DOM with the specified root element name, and fills it
by introspecting the passed object.
|
Element |
convert(Object obj,
String nsUri,
String rootName)
Creates an XML DOM with the specified root element name and namespace
URI, and fills it by introspecting the passed object.
|
List<ConversionException> |
getDeferredExceptions()
If the deferred exceptions option has been set, returns the list of
deferred exceptions.
|
public Bean2XmlConverter(Bean2XmlOptions... options)
public Element convert(Object obj, String rootName)
Neither elements nor attributes in the resulting DOM are namespaced.
public Element convert(Object obj, String nsUri, String rootName)
All decendent elements will use the same namespace URI (and prefix, if
provided) as the root. Attributes created by the converter use the
"conversion" namespace, found in ConversionConstants
.
public List<ConversionException> getDeferredExceptions()
The returned list is immutable.