Interface XMLSerializer<R,​P extends R>

  • Type Parameters:
    R - The class of object which the serializer can serialize (what it requires).
    P - The class of object which will be provided by this serializer when it parses data.
    All Superinterfaces:
    Serializer<R,​P>

    @ComponentRole
    public interface XMLSerializer<R,​P extends R>
    extends Serializer<R,​P>
    A Serializer which converts objects into XML Elements and back.
    Since:
    3.0M2
    Version:
    $Id: 093e25a436676efed70643c203455e07384601f1 $
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      P parse​(org.dom4j.Element xmlElement)
      Deserialize from an XML Element.
      void serialize​(R object, org.xwiki.store.serialization.xml.internal.XMLWriter writeTo)
      Serialize to an XMLWriter.
    • Method Detail

      • parse

        P parse​(org.dom4j.Element xmlElement)
         throws IOException
        Deserialize from an XML Element.
        Parameters:
        xmlElement - the root element of a serialized object.
        Returns:
        a new object made by deserializing the XML Element.
        Throws:
        IOException - if something goes wrong.
      • serialize

        void serialize​(R object,
                       org.xwiki.store.serialization.xml.internal.XMLWriter writeTo)
                throws IOException
        Serialize to an XMLWriter.
        Parameters:
        object - the object to serialize.
        writeTo - write output to this.
        Throws:
        IOException - if something goes wrong.