Class XmlSerializer
- java.lang.Object
-
- org.apache.ofbiz.entity.serialize.XmlSerializer
-
public class XmlSerializer extends java.lang.Object
XmlSerializer class. This class is deprecated - new code should use the Java object marshalling/unmarshalling methods inUtilXml.java
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
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 DOMDocument
.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)
-
-
-
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
orGenericPK
then it is possible to unintentionally corrupt the database.- Parameters:
content
- the contentdelegator
- 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 DOMDocument
.This method should be used with caution. If the DOM
Document
contains a serializedGenericValue
orGenericPK
then it is possible to unintentionally corrupt the database.- Parameters:
document
- the documentdelegator
- 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)
-
deserializeSingle
public static java.lang.Object deserializeSingle(org.w3c.dom.Element element, Delegator delegator) throws SerializeException
- Throws:
SerializeException
-
deserializeCustom
public static java.lang.Object deserializeCustom(org.w3c.dom.Element element) throws SerializeException
- Throws:
SerializeException
-
-