public abstract class ValueSemanticsProviderAbstractTemporal<T> extends ValueSemanticsProviderAndFacetAbstract<T> implements DateValueFacet
ValueSemanticsProviderAndFacetAbstract.EqualByContent, ValueSemanticsProviderAndFacetAbstract.ImmutabilityFacetAbstract.Derivation, FacetAbstract.Disabling, FacetAbstract.Hiding, FacetAbstract.Validating| Modifier and Type | Field and Description |
|---|---|
protected DateFormat |
format |
static String |
FORMAT_KEY_PREFIX |
protected static String |
ISO_ENCODING_FORMAT |
protected static TimeZone |
UTC_TIME_ZONE |
| Constructor and Description |
|---|
ValueSemanticsProviderAbstractTemporal(String propertyType,
Class<? extends Facet> facetType,
FacetHolder holder,
Class<T> adaptedClass,
int typicalLength,
ValueSemanticsProviderAndFacetAbstract.Immutability immutability,
ValueSemanticsProviderAndFacetAbstract.EqualByContent equalByContent,
T defaultValue,
IsisConfiguration configuration,
ValueSemanticsProviderContext context)
Allows the specific facet subclass to be specified (rather than use
type(). |
ValueSemanticsProviderAbstractTemporal(String propertyName,
FacetHolder holder,
Class<T> adaptedClass,
int typicalLength,
ValueSemanticsProviderAndFacetAbstract.Immutability immutability,
ValueSemanticsProviderAndFacetAbstract.EqualByContent equalByContent,
T defaultValue,
IsisConfiguration configuration,
ValueSemanticsProviderContext context)
Uses
type() as the facet type. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
add(T original,
int years,
int months,
int days,
int hours,
int minutes) |
protected void |
buildDefaultFormatIfRequired() |
protected void |
buildFormat(String configuredFormat) |
protected void |
clearFields(Calendar cal) |
protected void |
configureFormats() |
protected static DateFormat |
createDateEncodingFormat(String mask)
for encoding always use UTC.
|
protected static DateFormat |
createDateFormat(String mask) |
ObjectAdapter |
createValue(Date date) |
protected abstract Date |
dateValue(Object value) |
Date |
dateValue(ObjectAdapter object) |
protected abstract String |
defaultFormat() |
protected String |
doEncode(Object object)
Hook method to perform the actual encoding.
|
protected T |
doParse(Object context,
String entry,
org.apache.isis.applib.profiles.Localization localization) |
protected T |
doRestore(String data)
Hook method to perform the actual restoring.
|
protected DateFormat |
format(org.apache.isis.applib.profiles.Localization localization) |
protected abstract Map<String,DateFormat> |
formats() |
protected abstract List<DateFormat> |
formatsToTry(org.apache.isis.applib.profiles.Localization localization) |
protected boolean |
ignoreTimeZone() |
protected boolean |
isEmpty() |
protected abstract T |
now() |
protected abstract T |
setDate(Date date) |
static void |
setFormat(String propertyType,
String formatStr)
Introduced to allow BDD tests to provide a different format string
"mid-flight".
|
void |
setMask(String mask) |
String |
titleString(Object value,
org.apache.isis.applib.profiles.Localization localization)
Return a string representation of aforesaid object.
|
String |
titleStringWithMask(Object value,
String usingMask) |
static Class<? extends Facet> |
type()
The facet type, used if not specified explicitly in the constructor.
|
alwaysReplace, createAdapter, determineNumberFormat, displayTitleOf, displayTitleOf, doParse, fromEncodedString, getAdaptedClass, getAdapterManager, getAuthenticationSessionProvider, getClock, getConfiguration, getContext, getDefaultsProvider, getDefaultValue, getDependencyInjector, getEncoderDecoder, getParser, getSpecification, getSpecificationLookup, isEqualByContent, isImmutable, parseableTitleOf, parseTextEntry, titleString, toEncodedString, typicalLengthfacetType, getFacetHolder, getIdentified, getUnderlyingFacet, isDerived, isNoop, setFacetHolder, setUnderlyingFacet, toString, toStringValuesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitalwaysReplace, facetType, getFacetHolder, getUnderlyingFacet, isDerived, isNoop, setFacetHolder, setUnderlyingFacetprotected static final String ISO_ENCODING_FORMAT
protected static final TimeZone UTC_TIME_ZONE
public static final String FORMAT_KEY_PREFIX
protected DateFormat format
public ValueSemanticsProviderAbstractTemporal(String propertyName, FacetHolder holder, Class<T> adaptedClass, int typicalLength, ValueSemanticsProviderAndFacetAbstract.Immutability immutability, ValueSemanticsProviderAndFacetAbstract.EqualByContent equalByContent, T defaultValue, IsisConfiguration configuration, ValueSemanticsProviderContext context)
type() as the facet type.public ValueSemanticsProviderAbstractTemporal(String propertyType, Class<? extends Facet> facetType, FacetHolder holder, Class<T> adaptedClass, int typicalLength, ValueSemanticsProviderAndFacetAbstract.Immutability immutability, ValueSemanticsProviderAndFacetAbstract.EqualByContent equalByContent, T defaultValue, IsisConfiguration configuration, ValueSemanticsProviderContext context)
type().public static void setFormat(String propertyType, String formatStr)
public static Class<? extends Facet> type()
protected static DateFormat createDateFormat(String mask)
protected static DateFormat createDateEncodingFormat(String mask)
protected void configureFormats()
protected void buildDefaultFormatIfRequired()
protected void buildFormat(String configuredFormat)
protected T doParse(Object context, String entry, org.apache.isis.applib.profiles.Localization localization)
doParse in class ValueSemanticsProviderAndFacetAbstract<T>protected abstract List<DateFormat> formatsToTry(org.apache.isis.applib.profiles.Localization localization)
public String titleString(Object value, org.apache.isis.applib.profiles.Localization localization)
ValueSemanticsProviderAndFacetAbstracttitleString in class ValueSemanticsProviderAndFacetAbstract<T>protected DateFormat format(org.apache.isis.applib.profiles.Localization localization)
public String titleStringWithMask(Object value, String usingMask)
titleStringWithMask in class ValueSemanticsProviderAndFacetAbstract<T>protected String doEncode(Object object)
ValueSemanticsProviderAndFacetAbstractdoEncode in class ValueSemanticsProviderAndFacetAbstract<T>protected T doRestore(String data)
ValueSemanticsProviderAndFacetAbstractdoRestore in class ValueSemanticsProviderAndFacetAbstract<T>public final Date dateValue(ObjectAdapter object)
dateValue in interface DateValueFacetpublic final ObjectAdapter createValue(Date date)
createValue in interface DateValueFacetprotected void clearFields(Calendar cal)
protected abstract String defaultFormat()
protected abstract Map<String,DateFormat> formats()
protected boolean ignoreTimeZone()
protected boolean isEmpty()
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.