|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.threeten.bp.format.DateTimeTextProvider
public abstract class DateTimeTextProvider
The Service Provider Interface (SPI) to be implemented by classes providing the textual form of a date-time field.
This class has been made pubilc primarily for the benefit of Android.
| Constructor Summary | |
|---|---|
DateTimeTextProvider()
|
|
| Method Summary | |
|---|---|
abstract String |
getText(TemporalField field,
long value,
TextStyle style,
Locale locale)
Gets the text for the specified field, locale and style for the purpose of printing. |
abstract Iterator<Map.Entry<String,Long>> |
getTextIterator(TemporalField field,
TextStyle style,
Locale locale)
Gets an iterator of text to field for the specified field, locale and style for the purpose of parsing. |
static void |
setInitializer(DateTimeTextProvider provider)
Sets the provider to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateTimeTextProvider()
| Method Detail |
|---|
public static void setInitializer(DateTimeTextProvider provider)
This can only be invoked before DateTimeTextProvider class is used for formatting/parsing.
Invoking this method at a later point will throw an exception.
provider - the provider to use
IllegalStateException - if initialization has already occurred or another provider has been set
public abstract String getText(TemporalField field,
long value,
TextStyle style,
Locale locale)
The text associated with the value is returned. The null return value should be used if there is no applicable text, or if the text would be a numeric representation of the value.
field - the field to get text for, not nullvalue - the field value to get text for, not nullstyle - the style to get text for, not nulllocale - the locale to get text for, not null
public abstract Iterator<Map.Entry<String,Long>> getTextIterator(TemporalField field,
TextStyle style,
Locale locale)
The iterator must be returned in order from the longest text to the shortest.
The null return value should be used if there is no applicable parsable text, or if the text would be a numeric representation of the value. Text can only be parsed if all the values for that field-style-locale combination are unique.
field - the field to get text for, not nullstyle - the style to get text for, null for all parsable textlocale - the locale to get text for, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||