Class XMLSerializer
java.lang.Object
com.inductiveautomation.ignition.common.xmlserialization.serialization.XMLSerializer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd another object to serializevoidaddRootAttribute(String key, String value) Merges the given attribute for the root element into the existing attributes (if any).voidaddSerializationDelegate(Class clazz, SerializationDelegate<?> delegate) voidaddSupertypeDelegate(Class clazz, SerializationDelegate<?> delegate) protected ElementcreateTopElement(List<Element> elements) Calls getClassNameMap().addDefaults() in a chaining invocation style.voidregisterEqualityDelegate(Class<?> clazz, EqualityDelegate<?> delegate) Deprecated.voidserialize(SerializationWriter writer) Serializes the object graph to the given serialization writer.voidserialize(OutputStream out) Deprecated.useserializeXML(OutputStream, String)instead.voidserialize(OutputStream out, String encoding) Deprecated.useserializeXML(OutputStream, String)instead.voidDeprecated.useserializeXML(Writer, String)instead.voidDeprecated.useserializeXML(Writer, String)instead.byte[]Deprecated.useserializeXMLAndGZip()instead.byte[]serializeAndGZip(Object obj) Deprecated.useserializeXMLAndGZip(Object)instead.byte[]serializeBinary(boolean gzip) Serialize using the binary format.voidserializeBinary(OutputStream stream) Serializes the added object(s) to the stream, and closes the stream.byte[]serializeBinary(Object object, boolean gzip) Serialize the given object using binary format.Serialize to non-compressed XML using the default encoding (UTF-8)voidserializeXML(OutputStream out, String encoding) Serialize to XML format using the specified encoding.voidserializeXML(Writer out, String encoding) Serialize to XML format using the specified encoding.byte[]Serializes and gzips using UTF-8 encodingbyte[]Convenience shortcut for:static voidsetCleanCopy(Class type, Object obj)
-
Field Details
-
DEFAULT_ENCODING
-
-
Constructor Details
-
XMLSerializer
public XMLSerializer()
-
-
Method Details
-
initDefaults
Calls getClassNameMap().addDefaults() in a chaining invocation style. -
addRootAttribute
Merges the given attribute for the root element into the existing attributes (if any). These attributes can be read on the deserialization side without needing to deserialize the entire structure. -
addSerializationDelegate
-
addSupertypeDelegate
-
addObject
Add another object to serialize -
serializeAndGZip
Deprecated.useserializeXMLAndGZip(Object)instead.- Throws:
SerializationException
-
serializeAndGZip
Deprecated.useserializeXMLAndGZip()instead.- Throws:
SerializationException
-
serializeXMLAndGZip
Convenience shortcut for:serializer.addObject(obj); return serializer.serializeXMLAndGZip();
- Throws:
SerializationException
-
serializeXMLAndGZip
Serializes and gzips using UTF-8 encoding- Throws:
SerializationException
-
serialize
Deprecated.UseserializeXML()instead.- Throws:
SerializationException
-
serialize
Deprecated.useserializeXML(OutputStream, String)instead.- Throws:
SerializationException
-
serialize
Deprecated.useserializeXML(OutputStream, String)instead.- Throws:
SerializationException
-
serialize
Deprecated.useserializeXML(Writer, String)instead.- Throws:
SerializationException
-
serialize
Deprecated.useserializeXML(Writer, String)instead.- Throws:
SerializationException
-
serializeXML
Serialize to non-compressed XML using the default encoding (UTF-8)- Throws:
SerializationException
-
serializeXML
Serialize to XML format using the specified encoding.- Throws:
SerializationException
-
serializeXML
Serialize to XML format using the specified encoding.- Throws:
SerializationException
-
serializeBinary
Serialize the given object using binary format. Shortcut for:serializer.addObject(object); serializer.serializeBinary(gzipFlag);
- Throws:
SerializationException
-
serializeBinary
Serialize using the binary format. Optional gzip compression.- Throws:
SerializationException
-
serializeBinary
Serializes the added object(s) to the stream, and closes the stream.- Throws:
SerializationException
-
serialize
Serializes the object graph to the given serialization writer.- Throws:
SerializationException
-
createTopElement
-
setCleanCopy
-
getClassNameMap
-
registerEqualityDelegate
-
serializeXML()instead.