Class DatePattern
java.lang.Object
com.aquima.interactions.framework.mask.impl.AbstractMask
com.aquima.interactions.framework.mask.impl.DatePattern
- All Implemented Interfaces:
IMask
This mask applies a date format with a specific pattern to a date(time) value. See
com.aquima.interactions.foundation.text.DateFormat for more pattern information. This mask extends the patterns of
date format with some extra pattern symbols:
- h: 12-hour hour notation.
- hh: 12-hour hour notation (with leading zeros).
- d: short representation of the day of the month.
- M: short representation of the month.
- yy: last two digits of the year.
- day: spelled day of the month.
- dayofweek: spelled day of the week.
- month: spelled month of the year.
- year: spelled year.
- pattern: the pattern to use.
- Since:
- 6.0
- Author:
- Jon van Leuven
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
applySingleValue
(ISingleValue singleValue, IMaskContext context, ILanguage language) This method is called when this mask is applied.protected DateFormat
createMaskDateFormat
(String pattern, IMaskContext context, ILanguage language) protected DataType[]
Should return the datatypes for which this mask can be applied.Methods inherited from class com.aquima.interactions.framework.mask.impl.AbstractMask
apply
-
Constructor Details
-
DatePattern
Construct a date pattern mask.- Parameters:
spellEngine
- Spell engine used for spelling dates.
-
-
Method Details
-
applySingleValue
protected String applySingleValue(ISingleValue singleValue, IMaskContext context, ILanguage language) throws Exception Description copied from class:AbstractMask
This method is called when this mask is applied.- Specified by:
applySingleValue
in classAbstractMask
- 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.
-
createMaskDateFormat
-
getValidDataTypes
Description copied from class:AbstractMask
Should return the datatypes for which this mask can be applied.- Specified by:
getValidDataTypes
in classAbstractMask
- Returns:
- Array of datatypes.
-