Class DefaultXmlDelegate
java.lang.Object
com.aquima.interactions.profile.xml.DefaultXmlDelegate
- All Implemented Interfaces:
IXmlDelegate
Default implementation of the xml delegate interface.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
includeAttribute
(IAttributeValue attributeValue) This method returns a boolean indicating whether the attribute should be processed by the XML converter.boolean
includeEntity
(IEntityDefinition definition) This method should return a boolean indicating if entities of the specified type should be processes by the XML converter.boolean
includeInstance
(IEntityInstance instance) This method should return a boolean indicating whether the instance should be processed by the XML converter.void
onException
(AppException error) This method may be implemented to add custom error handling.valueToXml
(IPrimitiveValue attributeValue) This method should convert the primitive value to a string value representation.xmlToValue
(DataType type, String stringValue) This method should convert a string value to the specified data type.
-
Constructor Details
-
DefaultXmlDelegate
public DefaultXmlDelegate()
-
-
Method Details
-
includeEntity
Description copied from interface:IXmlDelegate
This method should return a boolean indicating if entities of the specified type should be processes by the XML converter. When this method returns false, all entity instances of this type will be excluded from the resulting XML and instances of this type will not be read into the profile.- Specified by:
includeEntity
in interfaceIXmlDelegate
- Parameters:
definition
- The entity type that should be included.- Returns:
- boolean indicating if entities of the specified type should be processes by the XML converter.
-
includeInstance
Description copied from interface:IXmlDelegate
This method should return a boolean indicating whether the instance should be processed by the XML converter.- Specified by:
includeInstance
in interfaceIXmlDelegate
- Parameters:
instance
- The instance for which should be determined if it should be processed.- Returns:
- boolean indicating whether the instance should be processed by the XML converter.
-
includeAttribute
Description copied from interface:IXmlDelegate
This method returns a boolean indicating whether the attribute should be processed by the XML converter.- Specified by:
includeAttribute
in interfaceIXmlDelegate
- Parameters:
attributeValue
- The attribute value for which should be determined if it should be processed.- Returns:
- boolean indicating whether the attribute should be processed by the XML converter.
-
valueToXml
Description copied from interface:IXmlDelegate
This method should convert the primitive value to a string value representation.- Specified by:
valueToXml
in interfaceIXmlDelegate
- Parameters:
attributeValue
- The primitive value for which the string representation is requested.- Returns:
- String value representation of the specified primitive value.
-
xmlToValue
Description copied from interface:IXmlDelegate
This method should convert a string value to the specified data type.- Specified by:
xmlToValue
in interfaceIXmlDelegate
- Parameters:
type
- The type to which the string value should be converted.stringValue
- The value that should be converted.- Returns:
- The primitive value for the specified string representation.
-
onException
Description copied from interface:IXmlDelegate
This method may be implemented to add custom error handling. The implementation may re-throw the error if needed, or choose to ignore the error. When an error is re-thrown, the XML converter will stop processing and fail with the specified error.- Specified by:
onException
in interfaceIXmlDelegate
- Parameters:
error
- The error that occurred during XML conversion.
-