Interface IXmlDelegate
- All Known Implementing Classes:
DefaultXmlDelegate
public interface IXmlDelegate
Interface for objects that wish to influence the behavior of the XML converter.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
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.
-
Method Details
-
includeEntity
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.- 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
This method should return a boolean indicating whether the instance should be processed by the XML converter.- 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
This method returns a boolean indicating whether the attribute should be processed by the XML converter.- 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
This method should convert the primitive value to a string value representation.- Parameters:
attributeValue
- The primitive value for which the string representation is requested.- Returns:
- String value representation of the specified primitive value.
-
xmlToValue
This method should convert a string value to the specified data type.- 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
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.- Parameters:
error
- The error that occurred during XML conversion.- Throws:
AppException
- This exception may be thrown to indicate the passed error was fatal.
-