Class DefaultObjectSerializationDelegate
java.lang.Object
com.inductiveautomation.ignition.common.xmlserialization.serialization.AbstractSerializationDelegate<Object>
com.inductiveautomation.ignition.common.xmlserialization.serialization.DefaultObjectSerializationDelegate
- All Implemented Interfaces:
- SerializationDelegate<Object>
- Direct Known Subclasses:
- BasicTranslationPackageDelegate,- BorderUIResourceDelegate,- DefaultComponentDelegate,- InteractionDescriptorDelegate,- ListDelegate,- LocaleDelegate,- MapDelegate,- ProjectTagDelegate,- PyStringDelegate,- SetDelegate,- ShapeComponentDelegate,- TagEventScriptsDelegate,- WindowDelegate
An implementation of SerializationDelegate that uses reflection and the JavaBean standard to try and serialize any
 arbitrary object
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Stringprotected static DescriptorComparatorprotected booleanstatic final StringKey for a PropertyDescriptor to mark itself transient.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates an object serializer that uses the default no-arg constructorDefaultObjectSerializationDelegate(boolean ctorOnly, String... properties) DefaultObjectSerializationDelegate(Class[] types, String[] properties) Uses the constructor that accepts the given properties as arguments.DefaultObjectSerializationDelegate(String... properties) Uses the constructor that accepts the given properties as arguments.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoProperty(XMLSerializationContext context, Element elm, PropertyDescriptor pd, Object obj, Object clean) Serializes the given property to the streamprotected voidinitConstructorTypes(Class clazz) booleanbooleanprotected booleanserialize(XMLSerializationContext context, Object obj) protected ElementserializeConstructor(XMLSerializationContext context, 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, 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, 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, Method method, Object... args) protected ElementwriteCall(XMLSerializationContext context, String methodName, Class[] argTypes, Object... args) Writes an <o:c> element, which represents a call to a method.protected ElementwriteConstructor(XMLSerializationContext context, Class[] types, Object[] args) 
- 
Field Details- 
TRANSIENT_KEYKey for a PropertyDescriptor to mark itself transient. Value should be Boolean.TRUE- See Also:
 
- 
propertyComparator
- 
elementName
- 
skipReferenceTrackingprotected boolean skipReferenceTracking
 
- 
- 
Constructor Details- 
DefaultObjectSerializationDelegatepublic DefaultObjectSerializationDelegate()Creates an object serializer that uses the default no-arg constructor
- 
DefaultObjectSerializationDelegateUses the constructor that accepts the given properties as arguments. This version creates a constructor-only serialization delegate.
- 
DefaultObjectSerializationDelegate
- 
DefaultObjectSerializationDelegateUses 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 Details- 
writeCallprotected Element writeCall(XMLSerializationContext context, Method method, Object... args) throws SerializationException - Throws:
- SerializationException
 
- 
writeCallprotected Element writeCall(XMLSerializationContext context, String methodName, Class[] argTypes, Object... args) throws SerializationException Writes an <o:c> element, which represents a call to a method.- Throws:
- SerializationException
 
- 
isTransient
- 
doPropertyprotected void doProperty(XMLSerializationContext context, Element elm, PropertyDescriptor pd, Object obj, Object clean) throws Exception Serializes the given property to the stream- Throws:
- Exception
 
- 
serializePropertiesprotected void serializeProperties(XMLSerializationContext context, Element elm, 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, 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
 
- 
serialize- Throws:
- SerializationException
 
- 
serializeConstructorprotected Element serializeConstructor(XMLSerializationContext context, 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, Class[] types, Object[] args) throws SerializationException - Throws:
- SerializationException
 
- 
initConstructorTypes- Throws:
- SerializationException
 
- 
isConstructorOnlypublic boolean isConstructorOnly()
- 
setConstructorOnlypublic void setConstructorOnly(boolean constructorOnly) 
- 
isSkipReferenceTrackingpublic boolean isSkipReferenceTracking()- Specified by:
- isSkipReferenceTrackingin interface- SerializationDelegate<Object>
- Overrides:
- isSkipReferenceTrackingin class- AbstractSerializationDelegate<Object>
 
- 
setSkipReferenceTrackingpublic void setSkipReferenceTracking(boolean skipReferenceTracking) 
 
-