Package net.time4j.format
Class TextAccessor
java.lang.Object
net.time4j.format.TextAccessor
Supplies an access to the internal name list of an enum-based element value.
- Since:
- 2.0
- Author:
- Meno Hochschild
- See Also:
CalendarText
-
Method Summary
Modifier and TypeMethodDescriptionObtains a list of all underlying text forms.<V extends Enum<V>>
Vparse(CharSequence parseable, ParsePosition status, Class<V> valueType)
Interpretes given text form as enum-based element value.<V extends Enum<V>>
Vparse(CharSequence parseable, ParsePosition status, Class<V> valueType, AttributeQuery attributes)
Interpretes given text form as enum-based element value.<V extends Enum<V>>
Vparse(CharSequence parseable, ParsePosition status, Class<V> valueType, Leniency leniency)
Interpretes given text form as enum-based element value.Prints the given element value as String.toString()
Supports mainly debugging.
-
Method Details
-
print
Prints the given element value as String.
If the element value has no localized representation then this method will simply print the enum name.
- Parameters:
value
- current value of element- Returns:
- localized text form
-
parse
public <V extends Enum<V>> V parse(CharSequence parseable, ParsePosition status, Class<V> valueType)Interpretes given text form as enum-based element value.
Parsing is case-insensitive. No partial compare is performed, instead the whole element text will be evaluated.
- Type Parameters:
V
- generic value type of element- Parameters:
parseable
- text to be parsedstatus
- current parsing positionvalueType
- value class of element- Returns:
- element value (as enum) or
null
if not found - See Also:
parse(CharSequence, ParsePosition, Class, AttributeQuery)
-
parse
public <V extends Enum<V>> V parse(CharSequence parseable, ParsePosition status, Class<V> valueType, Leniency leniency)Interpretes given text form as enum-based element value.
- Type Parameters:
V
- generic value type of element- Parameters:
parseable
- text to be parsedstatus
- current parsing positionvalueType
- value class of elementleniency
- leniency mode- Returns:
- element value (as enum) or
null
if not found - Since:
- 3.15/4.12
- See Also:
Attributes.LENIENCY
,parse(CharSequence, ParsePosition, Class, AttributeQuery)
-
parse
public <V extends Enum<V>> V parse(CharSequence parseable, ParsePosition status, Class<V> valueType, AttributeQuery attributes)Interpretes given text form as enum-based element value.
The attributes
Attributes.PARSE_CASE_INSENSITIVE
andAttributes.PARSE_PARTIAL_COMPARE
will be evaluated.- Type Parameters:
V
- generic value type of element- Parameters:
parseable
- text to be parsedstatus
- current parsing positionvalueType
- value class of elementattributes
- format attributes- Returns:
- element value (as enum) or
null
if not found - See Also:
Attributes.PARSE_CASE_INSENSITIVE
,Attributes.PARSE_PARTIAL_COMPARE
-
getTextForms
Obtains a list of all underlying text forms.
- Returns:
- unmodifiable list of text resources
- Since:
- 3.32/4.27
-
toString
Supports mainly debugging.
-