Class XmlSerializer
java.lang.Object
org.apache.ofbiz.entity.serialize.XmlSerializer
XmlSerializer class. This class is deprecated - new code should use the
Java object marshalling/unmarshalling methods in
UtilXml.java
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
deserialize
(String content, Delegator delegator) Deserialize a Java object from an XML string.static Object
deserialize
(Document document, Delegator delegator) Deserialize a Java object from a DOMDocument
.static Object
deserializeCustom
(Element element) static Object
deserializeSingle
(Element element, Delegator delegator) static Element
makeElement
(String elementName, Object value, Document document) static String
static Element
serializeCustom
(Object object, Document document) static Element
serializeSingle
(Object object, Document document)
-
Constructor Details
-
XmlSerializer
public XmlSerializer()
-
-
Method Details
-
serialize
public static String serialize(Object object) throws SerializeException, FileNotFoundException, IOException -
deserialize
public static Object deserialize(String content, Delegator delegator) throws SerializeException, SAXException, ParserConfigurationException, 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
SAXException
ParserConfigurationException
IOException
-
deserialize
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
- Throws:
SerializeException
-
serializeCustom
- Throws:
SerializeException
-
makeElement
-
deserializeSingle
public static Object deserializeSingle(Element element, Delegator delegator) throws SerializeException - Throws:
SerializeException
-
deserializeCustom
- Throws:
SerializeException
-