public static class XMLFormat.Default extends XMLFormat<Object>
plain text format
; this XML representation consists
of the plain text representation of the object as a "value" attribute.XMLFormat.Default, XMLFormat.InputElement, XMLFormat.OutputElement
Constructor and Description |
---|
XMLFormat.Default()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isReferenceable()
Indicates if the object serialized through this format can be referenced
to (default
true ). |
Object |
newInstance(Class<?> cls,
XMLFormat.InputElement xml)
Allocates a new object of the specified class from the specified
XML input element.
|
void |
read(XMLFormat.InputElement xml,
Object obj)
Parses an XML input element into the specified object.
|
void |
write(Object obj,
XMLFormat.OutputElement xml)
Formats an object into the specified XML output element.
|
public boolean isReferenceable()
XMLFormat
true
). This method can be overriden to return
false
if serialized objects are manipulated "by value".isReferenceable
in class XMLFormat<Object>
true
if serialized object may hold a reference;
false
otherwise.XMLReferenceResolver
public Object newInstance(Class<?> cls, XMLFormat.InputElement xml) throws XMLStreamException
XMLFormat
newInstance
in class XMLFormat<Object>
cls
- the class of the object to return.xml
- the XML input element.XMLStreamException
public void read(XMLFormat.InputElement xml, Object obj) throws XMLStreamException
XMLFormat
read
in class XMLFormat<Object>
xml
- the XML element to parse.obj
- the object created through XMLFormat.newInstance(java.lang.Class<? extends T>, javolution.xml.XMLFormat.InputElement)
and to setup from the specified XML element.XMLStreamException
public void write(Object obj, XMLFormat.OutputElement xml) throws XMLStreamException
XMLFormat
write
in class XMLFormat<Object>
obj
- the object to format.xml
- the XMLElement
destination.XMLStreamException
Copyright © 2005-2013 Javolution. All Rights Reserved.