Package com.bc.ceres.binding.dom
Class XStreamDomConverter
java.lang.Object
com.bc.ceres.binding.dom.XStreamDomConverter
- All Implemented Interfaces:
DomConverter
todo - add API doc
- Since:
- BEAM 4.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureXStream
(com.thoughtworks.xstream.XStream xStream) convertDomToValue
(DomElement parentElement, Object value) Converts a DOM to a (complex) value of the type returned byDomConverter.getValueType()
.void
convertValueToDom
(Object value, DomElement parentElement) Converts a (complex) value of the type returned byDomConverter.getValueType()
to its DOM representation which may be further converted to XML.Class
<?> Gets the value type, which may be abstract.com.thoughtworks.xstream.XStream
-
Constructor Details
-
XStreamDomConverter
-
-
Method Details
-
getValueType
Description copied from interface:DomConverter
Gets the value type, which may be abstract.- Specified by:
getValueType
in interfaceDomConverter
- Returns:
- The value type.
-
convertDomToValue
public Object convertDomToValue(DomElement parentElement, Object value) throws ConversionException, ValidationException Description copied from interface:DomConverter
Converts a DOM to a (complex) value of the type returned byDomConverter.getValueType()
.- Specified by:
convertDomToValue
in interfaceDomConverter
- Parameters:
parentElement
- The parent DOM element.value
- The value which receives the DOM representation of the value ornull
. Ifvalue
isnull
, the method is responsible for the creation of a new instance and its configuration using the DOM.- Returns:
- The converted value, never
null
. - Throws:
ConversionException
- If the conversion fails.ValidationException
- If the converted value is invalid.
-
convertValueToDom
Description copied from interface:DomConverter
Converts a (complex) value of the type returned byDomConverter.getValueType()
to its DOM representation which may be further converted to XML. The givenvalue
can be safely cast to the type returned byDomConverter.getValueType()
.- Specified by:
convertValueToDom
in interfaceDomConverter
- Parameters:
value
- The value to be converted to the DOM. Nevernull
.parentElement
- The parent DOM element, which receives the DOM representation of the value.- Throws:
ConversionException
- If the conversion fails (e.g. not implemented).
-
getXStream
public com.thoughtworks.xstream.XStream getXStream() -
configureXStream
protected void configureXStream(com.thoughtworks.xstream.XStream xStream)
-