Class XmlSerializer


  • public class XmlSerializer
    extends java.lang.Object
    XmlSerializer class. This class is deprecated - new code should use the Java object marshalling/unmarshalling methods in UtilXml.java.
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlSerializer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object deserialize​(java.lang.String content, Delegator delegator)
      Deserialize a Java object from an XML string.
      static java.lang.Object deserialize​(org.w3c.dom.Document document, Delegator delegator)
      Deserialize a Java object from a DOM Document.
      static java.lang.Object deserializeCustom​(org.w3c.dom.Element element)  
      static java.lang.Object deserializeSingle​(org.w3c.dom.Element element, Delegator delegator)  
      static org.w3c.dom.Element makeElement​(java.lang.String elementName, java.lang.Object value, org.w3c.dom.Document document)  
      static java.lang.String serialize​(java.lang.Object object)  
      static org.w3c.dom.Element serializeCustom​(java.lang.Object object, org.w3c.dom.Document document)  
      static org.w3c.dom.Element serializeSingle​(java.lang.Object object, org.w3c.dom.Document document)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlSerializer

        public XmlSerializer()
    • Method Detail

      • serialize

        public static java.lang.String serialize​(java.lang.Object object)
                                          throws SerializeException,
                                                 java.io.FileNotFoundException,
                                                 java.io.IOException
        Throws:
        SerializeException
        java.io.FileNotFoundException
        java.io.IOException
      • deserialize

        public static java.lang.Object deserialize​(java.lang.String content,
                                                   Delegator delegator)
                                            throws SerializeException,
                                                   org.xml.sax.SAXException,
                                                   javax.xml.parsers.ParserConfigurationException,
                                                   java.io.IOException
        Deserialize a Java object from an XML string.

        This method should be used with caution. If the XML string contains a serialized GenericValue or GenericPK then it is possible to unintentionally corrupt the database.

        Parameters:
        content - the content
        delegator - the delegator
        Returns:
        return a deserialized object from XML string
        Throws:
        SerializeException
        org.xml.sax.SAXException
        javax.xml.parsers.ParserConfigurationException
        java.io.IOException
      • deserialize

        public static java.lang.Object deserialize​(org.w3c.dom.Document document,
                                                   Delegator delegator)
                                            throws SerializeException
        Deserialize a Java object from a DOM Document.

        This method should be used with caution. If the DOM Document contains a serialized GenericValue or GenericPK then it is possible to unintentionally corrupt the database.

        Parameters:
        document - the document
        delegator - the delegator
        Returns:
        returns a deserialized object from a DOM document
        Throws:
        SerializeException
      • serializeSingle

        public static org.w3c.dom.Element serializeSingle​(java.lang.Object object,
                                                          org.w3c.dom.Document document)
                                                   throws SerializeException
        Throws:
        SerializeException
      • serializeCustom

        public static org.w3c.dom.Element serializeCustom​(java.lang.Object object,
                                                          org.w3c.dom.Document document)
                                                   throws SerializeException
        Throws:
        SerializeException
      • makeElement

        public static org.w3c.dom.Element makeElement​(java.lang.String elementName,
                                                      java.lang.Object value,
                                                      org.w3c.dom.Document document)