public abstract class TermporalAccessorValue<TYPE extends TemporalAccessor> extends Object implements IValueObject<TYPE>
PATTERN_BASIC_ISO_DATE, PATTERN_CURRENCY, PATTERN_FULL, PATTERN_INTEGER, PATTERN_ISO_DATE, PATTERN_ISO_DATE_TIME, PATTERN_ISO_INSTANT, PATTERN_ISO_LOCAL_DATE, PATTERN_ISO_LOCAL_DATE_TIME, PATTERN_ISO_LOCAL_TIME, PATTERN_ISO_OFFSET_DATE, PATTERN_ISO_OFFSET_DATE_TIME, PATTERN_ISO_OFFSET_TIME, PATTERN_ISO_ORDINAL_DATE, PATTERN_ISO_TIME, PATTERN_ISO_WEEK_DATE, PATTERN_ISO_ZONED_DATE_TIME, PATTERN_LONG, PATTERN_MEDIUM, PATTERN_PERCENT, PATTERN_RFC_1123_DATE_TIME, PATTERN_SHORT, RESOLVER_LENIENT, RESOLVER_LENIENT_NO_BRACKETS, RESOLVER_SMART, RESOLVER_SMART_NO_BRACKETS, RESOLVER_STRICT, RESOLVER_STRICT_NO_BRACKETS
Constructor and Description |
---|
TermporalAccessorValue() |
Modifier and Type | Method and Description |
---|---|
static ZoneOffset |
_getSystemZoneOffset()
Helper to get the system ZoneOffset.
|
Format |
getFormatter(String pattern,
LocaleInfo localeInfo)
Returns the Formatter for a pattern.
|
TYPE |
load(String value,
Element element)
Loads the value from an Element.
|
abstract TYPE |
parse(String value,
DateTimeFormatter formatter)
Creates a Value object from a String using a specified pattern and locale.
|
TYPE |
parse(String value,
String pattern,
LocaleInfo localeInfo)
Creates a Value object from a String using a specified pattern and locale.
|
String |
save(TYPE value,
Element element)
Saves the value to an Element.
|
String |
toString(TYPE value)
The default "toString" representation.
|
String |
toString(TYPE value,
String pattern,
LocaleInfo localeInfo)
Formats the value to a String.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asLong, asLongCast, convert, createDefault, getDescription, getValueClass, getValueType, isRightAligned, parse, saveCast, toStringCast, toStringForced
public static ZoneOffset _getSystemZoneOffset()
public final Format getFormatter(String pattern, LocaleInfo localeInfo)
getFormatter
in interface IValueObject<TYPE extends TemporalAccessor>
pattern
- The pattern to use, null for none.localeInfo
- The locale information instance, or null for none.public final String toString(TYPE value)
toString
in interface IValueObject<TYPE extends TemporalAccessor>
value
- The value could be null.public String toString(TYPE value, String pattern, LocaleInfo localeInfo)
toString
in interface IValueObject<TYPE extends TemporalAccessor>
value
- The value is never null.pattern
- Pattern to use, null for none.localeInfo
- The locale information instance, or null for none.public abstract TYPE parse(String value, DateTimeFormatter formatter) throws ParseException, Exception
value
- The value, never null.formatter
- The formatter, never null.ParseException
- If the value could not be parsed.Exception
- For other errors.public final TYPE parse(String value, String pattern, LocaleInfo localeInfo) throws ParseException, Exception
parse
in interface IValueObject<TYPE extends TemporalAccessor>
value
- The value, never null.pattern
- The pattern, null for none.localeInfo
- The locale info, null for default.ParseException
- If the value could not be parsed.Exception
- For other errors.public final TYPE load(String value, Element element) throws Exception
load
in interface IValueObject<TYPE extends TemporalAccessor>
value
- The String value in the element.element
- The element holding the information for advanced processing using JAXB.Exception
- An exception due to parsing, bean unmarshalling, etc.public final String save(TYPE value, Element element) throws Exception
save
in interface IValueObject<TYPE extends TemporalAccessor>
value
- The value to save.element
- The element to save information into for advanced processing using JAXB.Exception
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.