Class AbstractMask
java.lang.Object
com.aquima.interactions.framework.mask.impl.AbstractMask
- All Implemented Interfaces:
IMask
- Direct Known Subclasses:
AbstractSubstringMask
,DatePattern
,HexadecimalInteger
,NumberPattern
,OctalInteger
,OrdinalNumber
,RegularExpression
,RomanInteger
,SpelledBoolean
,SpelledCurrency
,SpelledDayOfWeek
,SpelledDeltaDate
,SpelledInteger
,SpelledMonth
,SpelledNumber
Abstract class to simplify mask implementations. All pre processing validations are done by this abstract class. If
the value passed in de mask context is unknown, then "" is returned.
- Since:
- 6.0
- Author:
- Jon van Leuven
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply
(IPrimitiveValue fieldValue, IMaskContext context) Apply the mask and return a multi lingual representation of an IPrimitiveValue.protected abstract String
applySingleValue
(ISingleValue singleValue, IMaskContext context, ILanguage language) This method is called when this mask is applied.protected abstract DataType[]
Should return the datatypes for which this mask can be applied.
-
Constructor Details
-
AbstractMask
public AbstractMask()
-
-
Method Details
-
getValidDataTypes
Should return the datatypes for which this mask can be applied.- Returns:
- Array of datatypes.
-
applySingleValue
protected abstract String applySingleValue(ISingleValue singleValue, IMaskContext context, ILanguage language) throws Exception This method is called when this mask is applied.- Parameters:
singleValue
- The value, never null and never unknown.context
- Mask contextlanguage
- the language- Returns:
- The applied mask result.
- Throws:
Exception
- When something went wrong.
-
apply
Description copied from interface:IMask
Apply the mask and return a multi lingual representation of an IPrimitiveValue.- Specified by:
apply
in interfaceIMask
- Parameters:
fieldValue
- The value to be used by the mask (never null).context
- The context in which the mask is called (never null).- Returns:
- The applied mask result which should never be null.
- Throws:
Exception
- When an unexpected exception occurs and the mask cannot be applied.
-