Overview | Package | Class | Tree | Deprecated | Index | Help
| J avolution v5.3 (J2SE 1.5+)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javolution.xml
Interface XMLSerializable

All Superinterfaces:
  java.io.Serializable

All Known Implementing Classes:
  AllocatorContext, ConcurrentContext, Context, FastBitSet, FastCollection, FastComparator, FastList, FastMap, FastSet, FastTable, HeapContext, ImmortalContext, Index, JUnitContext, LocalContext, LogContext, PersistentContext, PoolContext, QName, SecurityContext, StackContext, StandardLog, TestContext, Text, TimeContext, XMLBinding

    public interface XMLSerializable

extends java.io.Serializable

This interface identifies classes supporting XML serialization (XML serialization is still possible for classes not implementing this interface through dynamic `XMLBinding` though).

Typically, classes implementing this interface have a static `XMLFormat` holding their default XML representation. For example:``

         public final class Complex implements XMLSerializable {

             // Use the cartesien form for the default XML representation.
             static final XMLFormat<Complex> XML = new XMLFormat<Complex>(Complex.class) {
                 public Complex newInstance(Class<Complex> cls, InputElement xml) throws XMLStreamException {
                     return Complex.valueOf(xml.getAttribute("real", 0.0),
                                            xml.getAttribute("imaginary", 0.0));
                 }
                 public void write(Complex complex, OutputElement xml) throws XMLStreamException {
                     xml.setAttribute("real", complex.getReal());
                     xml.setAttribute("imaginary", complex.getImaginary());
                 }
                 public void read(InputElement xml, Complex complex) {
                     // Immutable, deserialization occurs at creation, ref. newIntance(...)
                  }
             };
             ...
         }

Version:
  4.2, April 15, 2007
Author:
  Jean-Marie Dautelle

Overview | Package | Class | Tree | Deprecated | Index | Help
| J avolution v5.3 (J2SE 1.5+)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 - 2009 Javolution.