Javolution 6.0.0 java
javolution.xml.DefaultXMLFormat Interface Reference

Public Member Functions

Class<? extends XMLFormat<?> > value ()
 

Detailed Description

Specifies the default xml format of a class (for xml serialization/deserialization). The default format is used by the javolution.xml.XMLObjectReader and javolution.xml.XMLObjectWriter classes. It can be locally overridden in the scope of a XMLContext.

[code] @DefaultXMLFormat(Complex.XML.class) public class Complex { public Complex(double real, double imaginary) { ... } public double getReal() { ... } public double getImaginary() { ... } public static class XML extends XMLFormat<Complex> { public Complex newInstance(Class<? extends Complex> cls, InputElement xml) throws XMLStreamException { return new Complex(xml.getAttribute("real", 0.0), xml.getAttribute("imaginary", 0.0)); } public void read(InputElement xml, Complex c) throws XMLStreamException { // Immutable object, no further processing. } public void write(Complex c, OutputElement xml) throws XMLStreamException { xml.setAttribute("real", c.getReal()); xml.setAttribute("imaginary", c.getImaginary()); } };
}[/code]

Author
Jean-Marie Dautelle
Version
6.0, July 21, 2013

Definition at line 52 of file DefaultXMLFormat.java.

Member Function Documentation

◆ value()

Class<? extends XMLFormat<?> > javolution.xml.DefaultXMLFormat.value ( )

Returns the default xml format of the annotated class.

Referenced by javolution.xml.internal.XMLContextImpl.searchFormat().

Here is the caller graph for this function:

The documentation for this interface was generated from the following file: