Class XMLSerializationContext


  • public class XMLSerializationContext
    extends java.lang.Object
    Used while serializing to keep track of references and indentation.
    • Constructor Detail

      • XMLSerializationContext

        public XMLSerializationContext​(XMLSerializer serializer)
    • Method Detail

      • serialize

        public Element serialize​(java.lang.Object obj)
                          throws SerializationException
        Uses the SerializationDelegate registered for this type of object to serialize the object into an Element. If the delegate is flagged for reference tracking and this object is equal to one already serialized earlier, a <ref> object will be returned instead.
        Throws:
        SerializationException
      • getRefForElement

        public int getRefForElement​(Element elm)
        Looks up the reference ID for the object within the Element, as long as the element doesn't have reference tracking turned off.