Class XMLSerializer
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.xmlserialization.serialization.XMLSerializer
 
- 
 public class XMLSerializer extends java.lang.Object
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringDEFAULT_ENCODING
 - 
Constructor SummaryConstructors Constructor Description XMLSerializer()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddObject(java.lang.Object obj)Add another object to serializevoidaddRootAttribute(java.lang.String key, java.lang.String value)Merges the given attribute for the root element into the existing attributes (if any).voidaddSerializationDelegate(java.lang.Class clazz, SerializationDelegate<?> delegate)voidaddSupertypeDelegate(java.lang.Class clazz, SerializationDelegate<?> delegate)protected ElementcreateTopElement(java.util.List<Element> elements)ClassNameResolvergetClassNameMap()XMLSerializerinitDefaults()Calls getClassNameMap().addDefaults() in a chaining invocation style.java.lang.Stringserialize()Deprecated.UseserializeXML()instead.voidserialize(SerializationWriter writer)Serializes the object graph to the given serialization writer.voidserialize(java.io.OutputStream out)Deprecated.useserializeXML(OutputStream, String)instead.voidserialize(java.io.OutputStream out, java.lang.String encoding)Deprecated.useserializeXML(OutputStream, String)instead.voidserialize(java.io.Writer out)Deprecated.useserializeXML(Writer, String)instead.voidserialize(java.io.Writer out, java.lang.String encoding)Deprecated.useserializeXML(Writer, String)instead.byte[]serializeAndGZip()Deprecated.useserializeXMLAndGZip()instead.byte[]serializeAndGZip(java.lang.Object obj)Deprecated.useserializeXMLAndGZip(Object)instead.byte[]serializeBinary(boolean gzip)Serialize using the binary format.voidserializeBinary(java.io.OutputStream stream)Serializes the added object(s) to the stream, and closes the stream.byte[]serializeBinary(java.lang.Object object, boolean gzip)Serialize the given object using binary format.java.lang.StringserializeXML()Serialize to non-compressed XML using the default encoding (UTF-8)voidserializeXML(java.io.OutputStream out, java.lang.String encoding)Serialize to XML format using the specified encoding.voidserializeXML(java.io.Writer out, java.lang.String encoding)Serialize to XML format using the specified encoding.byte[]serializeXMLAndGZip()Serializes and gzips using UTF-8 encodingbyte[]serializeXMLAndGZip(java.lang.Object obj)Convenience shortcut for:static voidsetCleanCopy(java.lang.Class type, java.lang.Object obj)
 
- 
- 
- 
Method Detail- 
initDefaultspublic XMLSerializer initDefaults() Calls getClassNameMap().addDefaults() in a chaining invocation style.
 - 
addRootAttributepublic void addRootAttribute(java.lang.String key, java.lang.String value)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.
 - 
addSerializationDelegatepublic void addSerializationDelegate(java.lang.Class clazz, SerializationDelegate<?> delegate)
 - 
addSupertypeDelegatepublic void addSupertypeDelegate(java.lang.Class clazz, SerializationDelegate<?> delegate)
 - 
addObjectpublic void addObject(java.lang.Object obj) Add another object to serialize
 - 
serializeAndGZip@Deprecated public byte[] serializeAndGZip(java.lang.Object obj) throws SerializationExceptionDeprecated.useserializeXMLAndGZip(Object)instead.- Throws:
- SerializationException
 
 - 
serializeAndGZip@Deprecated public byte[] serializeAndGZip() throws SerializationExceptionDeprecated.useserializeXMLAndGZip()instead.- Throws:
- SerializationException
 
 - 
serializeXMLAndGZippublic byte[] serializeXMLAndGZip(java.lang.Object obj) throws SerializationExceptionConvenience shortcut for:serializer.addObject(obj); return serializer.serializeXMLAndGZip(); - Throws:
- SerializationException
 
 - 
serializeXMLAndGZippublic byte[] serializeXMLAndGZip() throws SerializationExceptionSerializes and gzips using UTF-8 encoding- Throws:
- SerializationException
 
 - 
serialize@Deprecated public java.lang.String serialize() throws SerializationExceptionDeprecated.UseserializeXML()instead.- Throws:
- SerializationException
 
 - 
serialize@Deprecated public void serialize(java.io.OutputStream out) throws SerializationExceptionDeprecated.useserializeXML(OutputStream, String)instead.- Throws:
- SerializationException
 
 - 
serialize@Deprecated public void serialize(java.io.OutputStream out, java.lang.String encoding) throws SerializationExceptionDeprecated.useserializeXML(OutputStream, String)instead.- Throws:
- SerializationException
 
 - 
serialize@Deprecated public void serialize(java.io.Writer out) throws SerializationExceptionDeprecated.useserializeXML(Writer, String)instead.- Throws:
- SerializationException
 
 - 
serialize@Deprecated public void serialize(java.io.Writer out, java.lang.String encoding) throws SerializationExceptionDeprecated.useserializeXML(Writer, String)instead.- Throws:
- SerializationException
 
 - 
serializeXMLpublic java.lang.String serializeXML() throws SerializationExceptionSerialize to non-compressed XML using the default encoding (UTF-8)- Throws:
- SerializationException
 
 - 
serializeXMLpublic void serializeXML(java.io.OutputStream out, java.lang.String encoding) throws SerializationExceptionSerialize to XML format using the specified encoding.- Throws:
- SerializationException
 
 - 
serializeXMLpublic void serializeXML(java.io.Writer out, java.lang.String encoding) throws SerializationExceptionSerialize to XML format using the specified encoding.- Throws:
- SerializationException
 
 - 
serializeBinarypublic byte[] serializeBinary(java.lang.Object object, boolean gzip) throws SerializationExceptionSerialize the given object using binary format. Shortcut for:serializer.addObject(object); serializer.serializeBinary(gzipFlag); - Throws:
- SerializationException
 
 - 
serializeBinarypublic byte[] serializeBinary(boolean gzip) throws SerializationExceptionSerialize using the binary format. Optional gzip compression.- Throws:
- SerializationException
 
 - 
serializeBinarypublic void serializeBinary(java.io.OutputStream stream) throws SerializationExceptionSerializes the added object(s) to the stream, and closes the stream.- Throws:
- SerializationException
 
 - 
serializepublic void serialize(SerializationWriter writer) throws SerializationException Serializes the object graph to the given serialization writer.- Throws:
- SerializationException
 
 - 
setCleanCopypublic static void setCleanCopy(java.lang.Class type, java.lang.Object obj)
 - 
getClassNameMappublic ClassNameResolver getClassNameMap() 
 
- 
 
-