Class AbstractSystemDataFormatter
java.lang.Object
de.aristaflow.adept2.model.common.systemdata.AbstractSystemDataFormatter
- All Implemented Interfaces:
SystemDataFormatter
- Direct Known Subclasses:
BasicSystemDataFormatter,LongDateSystemDataFormatter,OrgPolicySystemDataFormatter
An abstract implementation of
SystemDataFormatter providing to helper
methods to ensure the presence of a value and the correctness of its type in
the provided map.- Author:
- Patrick Schmidt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidensureCorrectType(ProcessConstants.AdeptDataType expectedType, String udtName, Serializable value) Throws anIllegalArgumentExceptionif the given object doesn't the specified data type and simply returns if it does.protected voidensureValuePresent(String parameterName, Map<String, ? extends Serializable> parameterValues) Simply returns if the specified parameter value is present and throws anIllegalArgumentExceptionif it isn't.format(String parameterisedString, Map<String, Serializable> parameterValues) Formats the given parameterised string according to the needs of theSystemDataConsumerit is used by.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.aristaflow.adept2.model.common.systemdata.SystemDataFormatter
format
-
Constructor Details
-
AbstractSystemDataFormatter
public AbstractSystemDataFormatter()
-
-
Method Details
-
ensureValuePresent
protected void ensureValuePresent(String parameterName, Map<String, ? extends Serializable> parameterValues) Simply returns if the specified parameter value is present and throws anIllegalArgumentExceptionif it isn't.- Parameters:
parameterName- name of the parameterparameterValues- map containing the parameter values- Throws:
IllegalArgumentException- if the value is not present (i.e. the key is missing in the map; the value may benullthough)
-
ensureCorrectType
protected void ensureCorrectType(ProcessConstants.AdeptDataType expectedType, String udtName, Serializable value) Throws anIllegalArgumentExceptionif the given object doesn't the specified data type and simply returns if it does.- Parameters:
expectedType- the expected data typeudtName- The name of the user-defined type if specified and known,nullotherwise.value- the value object- Throws:
IllegalArgumentException- if the object's type doesn't match the expected data type
-
format
Description copied from interface:SystemDataFormatterFormats the given parameterised string according to the needs of theSystemDataConsumerit is used by.- Specified by:
formatin interfaceSystemDataFormatter- Parameters:
parameterisedString- the parameterised string to be formattedparameterValues- map containing values for all parameters referenced in the parameterised string- Returns:
- the formatted string
-