Class DefaultObjectSerializationDelegate
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.xmlserialization.serialization.AbstractSerializationDelegate<java.lang.Object>
- 
- com.inductiveautomation.ignition.common.xmlserialization.serialization.DefaultObjectSerializationDelegate
 
 
- 
- All Implemented Interfaces:
- SerializationDelegate<java.lang.Object>
 - Direct Known Subclasses:
- BasicTranslationPackageDelegate,- BorderUIResourceDelegate,- DefaultComponentDelegate,- InteractionDescriptorDelegate,- ListDelegate,- LocaleDelegate,- MapDelegate,- ProjectTagDelegate,- PyStringDelegate,- SetDelegate,- ShapeComponentDelegate,- TagEventScriptsDelegate,- WindowDelegate
 
 public class DefaultObjectSerializationDelegate extends AbstractSerializationDelegate<java.lang.Object> An implementation of SerializationDelegate that uses reflection and the JavaBean standard to try and serialize any arbitrary object
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.StringelementNameprotected static java.util.Map<java.lang.Class,com.inductiveautomation.ignition.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.EqualityDelegate>equalityDelegatesprotected static DescriptorComparatorpropertyComparatorprotected booleanskipReferenceTrackingstatic java.lang.StringTRANSIENT_KEYKey for a PropertyDescriptor to mark itself transient.
 - 
Constructor SummaryConstructors Constructor Description DefaultObjectSerializationDelegate()Creates an object serializer that uses the default no-arg constructorDefaultObjectSerializationDelegate(boolean ctorOnly, java.lang.String... properties)DefaultObjectSerializationDelegate(java.lang.Class[] types, java.lang.String[] properties)Uses the constructor that accepts the given properties as arguments.DefaultObjectSerializationDelegate(java.lang.String... properties)Uses the constructor that accepts the given properties as arguments.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoProperty(XMLSerializationContext context, Element elm, java.beans.PropertyDescriptor pd, java.lang.Object obj, java.lang.Object clean)Serializes the given property to the streamprotected voidinitConstructorTypes(java.lang.Class clazz)booleanisConstructorOnly()booleanisSkipReferenceTracking()protected booleanisTransient(java.beans.PropertyDescriptor pd)static booleansafeArrayEquals(java.lang.Object[] a, java.lang.Object[] a2)static booleansafeEquals(java.lang.Object foo, java.lang.Object bar)equals that uses null-safe equality (null==null: true) and the delegates to the equalityDelegates if there is one registered for the argument class.Elementserialize(XMLSerializationContext context, java.lang.Object obj)protected ElementserializeConstructor(XMLSerializationContext context, java.lang.Object obj)Gathers up the values for the properties named for an explicit constructor call, and then writes the call to the constructorprotected voidserializeProperties(XMLSerializationContext context, Element elm, java.lang.Object obj)Runs through the javabean properties of the given object, and comares the values of each property to the value that a clean copy of the object would have.voidsetConstructorOnly(boolean constructorOnly)voidsetSkipReferenceTracking(boolean skipReferenceTracking)protected ElementstartObject(XMLSerializationContext context, java.lang.Object obj)Creates an Element with this delegate's element name and with the "cls" attribute set to the object's class.protected ElementwriteCall(XMLSerializationContext context, java.lang.reflect.Method method, java.lang.Object... args)protected ElementwriteCall(XMLSerializationContext context, java.lang.String methodName, java.lang.Class[] argTypes, java.lang.Object... args)Writes an <o:c> element, which represents a call to a method.protected ElementwriteConstructor(XMLSerializationContext context, java.lang.Class[] types, java.lang.Object[] args)
 
- 
- 
- 
Field Detail- 
TRANSIENT_KEYpublic static final java.lang.String TRANSIENT_KEY Key for a PropertyDescriptor to mark itself transient. Value should be Boolean.TRUE- See Also:
- Constant Field Values
 
 - 
propertyComparatorprotected static DescriptorComparator propertyComparator 
 - 
elementNameprotected java.lang.String elementName 
 - 
skipReferenceTrackingprotected boolean skipReferenceTracking 
 - 
equalityDelegatesprotected static java.util.Map<java.lang.Class,com.inductiveautomation.ignition.common.xmlserialization.serialization.DefaultObjectSerializationDelegate.EqualityDelegate> equalityDelegates 
 
- 
 - 
Constructor Detail- 
DefaultObjectSerializationDelegatepublic DefaultObjectSerializationDelegate() Creates an object serializer that uses the default no-arg constructor
 - 
DefaultObjectSerializationDelegatepublic DefaultObjectSerializationDelegate(java.lang.String... properties) Uses the constructor that accepts the given properties as arguments. This version creates a constructor-only serialization delegate.
 - 
DefaultObjectSerializationDelegatepublic DefaultObjectSerializationDelegate(boolean ctorOnly, java.lang.String... properties)
 - 
DefaultObjectSerializationDelegatepublic DefaultObjectSerializationDelegate(java.lang.Class[] types, java.lang.String[] properties)Uses the constructor that accepts the given properties as arguments. This constructor explicitly defines the types of the arguments accepted by the constructor in cases where it might be ambiguous.
 
- 
 - 
Method Detail- 
safeEqualspublic static boolean safeEquals(java.lang.Object foo, java.lang.Object bar)equals that uses null-safe equality (null==null: true) and the delegates to the equalityDelegates if there is one registered for the argument class.
 - 
safeArrayEqualspublic static boolean safeArrayEquals(java.lang.Object[] a, java.lang.Object[] a2)
 - 
writeCallprotected Element writeCall(XMLSerializationContext context, java.lang.reflect.Method method, java.lang.Object... args) throws SerializationException - Throws:
- SerializationException
 
 - 
writeCallprotected Element writeCall(XMLSerializationContext context, java.lang.String methodName, java.lang.Class[] argTypes, java.lang.Object... args) throws SerializationException Writes an <o:c> element, which represents a call to a method.- Throws:
- SerializationException
 
 - 
isTransientprotected boolean isTransient(java.beans.PropertyDescriptor pd) 
 - 
doPropertyprotected void doProperty(XMLSerializationContext context, Element elm, java.beans.PropertyDescriptor pd, java.lang.Object obj, java.lang.Object clean) throws java.lang.Exception Serializes the given property to the stream- Throws:
- java.lang.Exception
 
 - 
serializePropertiesprotected void serializeProperties(XMLSerializationContext context, Element elm, java.lang.Object obj) throws SerializationException Runs through the javabean properties of the given object, and comares the values of each property to the value that a clean copy of the object would have. Serializes all properties that have a dirty value.- Throws:
- SerializationException
 
 - 
startObjectprotected Element startObject(XMLSerializationContext context, java.lang.Object obj) throws SerializationException Creates an Element with this delegate's element name and with the "cls" attribute set to the object's class.- Throws:
- SerializationException
 
 - 
serializepublic Element serialize(XMLSerializationContext context, java.lang.Object obj) throws SerializationException - Throws:
- SerializationException
 
 - 
serializeConstructorprotected Element serializeConstructor(XMLSerializationContext context, java.lang.Object obj) throws SerializationException Gathers up the values for the properties named for an explicit constructor call, and then writes the call to the constructor- Throws:
- SerializationException
 
 - 
writeConstructorprotected Element writeConstructor(XMLSerializationContext context, java.lang.Class[] types, java.lang.Object[] args) throws SerializationException - Throws:
- SerializationException
 
 - 
initConstructorTypesprotected void initConstructorTypes(java.lang.Class clazz) throws SerializationException- Throws:
- SerializationException
 
 - 
isConstructorOnlypublic boolean isConstructorOnly() 
 - 
setConstructorOnlypublic void setConstructorOnly(boolean constructorOnly) 
 - 
isSkipReferenceTrackingpublic boolean isSkipReferenceTracking() - Specified by:
- isSkipReferenceTrackingin interface- SerializationDelegate<java.lang.Object>
- Overrides:
- isSkipReferenceTrackingin class- AbstractSerializationDelegate<java.lang.Object>
 
 - 
setSkipReferenceTrackingpublic void setSkipReferenceTracking(boolean skipReferenceTracking) 
 
- 
 
-