T - generic type of chronological entitypublic final class ChronoFormatter<T extends ChronoEntity<T>> extends Object implements ChronoPrinter<T>, ChronoParser<T>, TemporalFormatter<T>
Represents a chronological format for the conversion between a chronological text and the chronological value of type T.
An instance can either be created via a Builder obtainable
by ChronoFormatter.setUp(Class, Locale) or by some predefined format constants
in Iso8601Format which can be adjusted by some
with()-methods. Another way to create an instance are the
methods formatter(...) and localFormatter(...) in
the classes PlainDate, PlainTime, PlainTimestamp
and Moment.
Note: This class is immutable and can be used by multiple threads in parallel.
| Modifier and Type | Class and Description |
|---|---|
static class |
ChronoFormatter.Builder<T extends ChronoEntity<T>>
Builder for creating a new
ChronoFormatter. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Compares the chronologies, default attributes, default values and
the internal format structures.
|
String |
format(GeneralTimestamp<?> tsp)
Prints given general timestamp.
|
String |
format(T formattable) |
void |
formatToBuffer(T formattable,
Appendable buffer) |
AttributeQuery |
getAttributes()
Returns the global format attributes which are active if they are not
overridden by sectional attributes.
|
Chronology<T> |
getChronology()
Returns the associated chronology.
|
Locale |
getLocale()
Returns the locale setting.
|
int |
hashCode() |
static ChronoFormatter<PlainDate> |
ofDatePattern(String pattern,
PatternType type,
Locale locale)
Constructs a pattern-based formatter for plain date objects.
|
static ChronoFormatter<PlainDate> |
ofDateStyle(DisplayMode style,
Locale locale)
Constructs a style-based formatter for plain date objects.
|
static ChronoFormatter<Moment> |
ofMomentPattern(String pattern,
PatternType type,
Locale locale,
TZID tzid)
Constructs a pattern-based formatter for global timestamp objects.
|
static ChronoFormatter<Moment> |
ofMomentStyle(DisplayMode dateStyle,
DisplayMode timeStyle,
Locale locale,
TZID tzid)
Constructs a style-based formatter for moments.
|
static <T extends ChronoEntity<T> & LocalizedPatternSupport> |
ofPattern(String pattern,
PatternType type,
Locale locale,
Chronology<T> chronology)
Constructs a pattern-based formatter for general chronologies.
|
static <T extends ChronoEntity<T> & LocalizedPatternSupport> |
ofStyle(DisplayStyle style,
Locale locale,
Chronology<T> chronology)
Constructs a style-based formatter for general chronologies.
|
static ChronoFormatter<PlainTime> |
ofTimePattern(String pattern,
PatternType type,
Locale locale)
Constructs a pattern-based formatter for clock time objects.
|
static ChronoFormatter<PlainTimestamp> |
ofTimestampPattern(String pattern,
PatternType type,
Locale locale)
Constructs a pattern-based formatter for plain timestamps.
|
static ChronoFormatter<PlainTimestamp> |
ofTimestampStyle(DisplayMode dateStyle,
DisplayMode timeStyle,
Locale locale)
Constructs a style-based formatter for plain timestamps.
|
static ChronoFormatter<PlainTime> |
ofTimeStyle(DisplayMode style,
Locale locale)
Constructs a style-based formatter for plain date objects.
|
T |
parse(CharSequence text) |
T |
parse(CharSequence text,
ParseLog status)
Interpretes given text as chronological entity starting
at the specified position in parse log.
|
T |
parse(CharSequence text,
ParseLog status,
AttributeQuery attributes)
Interpretes given text as chronological entity starting
at the specified position in parse log.
|
T |
parse(CharSequence text,
ParsePosition position)
For maximum information use
ChronoFormatter.parse(CharSequence, ParseLog) instead. |
T |
parse(CharSequence text,
ParsePosition position,
RawValues rawValues) |
ChronoEntity<?> |
parseRaw(CharSequence text,
int offset)
Translates given text as raw chronological entity without
converting to the target type of the underlying chronology.
|
ChronoEntity<?> |
parseRaw(String text)
Translates given text as raw chronological entity without
converting to the target type of the underlying chronology.
|
Set<ElementPosition> |
print(T formattable,
Appendable buffer,
AttributeQuery attributes)
Prints given chronological entity as formatted text and writes
the text into given buffer.
|
<R> R |
print(T formattable,
Appendable buffer,
AttributeQuery attributes,
ChronoFunction<ChronoDisplay,R> query)
Creates a text output and writes it into given buffer.
|
Set<ElementPosition> |
print(T formattable,
StringBuilder buffer)
Prints given chronological entity as formatted text and writes
the text into given buffer.
|
static <T extends ChronoEntity<T>> |
setUp(Chronology<T> chronology,
Locale locale)
Constructs a builder for creating formatters.
|
static <T extends ChronoEntity<T>> |
setUp(Class<T> type,
Locale locale)
Constructs a builder for creating formatters.
|
static <C extends CalendarVariant<C>> |
setUpWithOverride(Locale locale,
CalendarFamily<C> overrideCalendar)
Constructs a builder for creating global formatters with usage of given calendar type.
|
static <C extends Calendrical<?,C>> |
setUpWithOverride(Locale locale,
Chronology<C> overrideCalendar)
Constructs a builder for creating global formatters with usage of given calendar type.
|
Format |
toFormat()
Converts this formatter into a traditional
java.text.Format-object. |
String |
toString()
For debugging purposes.
|
<A extends Enum<A>> |
with(AttributeKey<A> key,
A value)
Creates a copy of this formatter with given enum-attribute.
|
ChronoFormatter<T> |
with(AttributeKey<Boolean> key,
boolean value)
Creates a copy of this formatter with given boolean-attribute.
|
ChronoFormatter<T> |
with(AttributeKey<Character> key,
char value)
Creates a copy of this formatter with given char-attribute.
|
ChronoFormatter<T> |
with(AttributeKey<Integer> key,
int value)
Creates a copy of this formatter with given int-attribute.
|
ChronoFormatter<T> |
with(Attributes attributes)
Creates a copy of this formatter with given standard attributes.
|
ChronoFormatter<T> |
with(ChronoHistory history)
Creates a copy of this formatter with the given chronological history of gregorian calendar reforms.
|
ChronoFormatter<T> |
with(Leniency leniency) |
ChronoFormatter<T> |
with(Locale locale)
Creates a copy of this formatter with given locale.
|
ChronoFormatter<T> |
with(StartOfDay startOfDay)
Sets the start of calendar day.
|
ChronoFormatter<T> |
with(Timezone tz)
Creates a copy of this formatter with given timezone which
shall be used in formatting or parsing.
|
ChronoFormatter<T> |
withAlternativeEraNames()
Creates a copy of this formatter with alternative era names.
|
ChronoFormatter<T> |
withCalendarVariant(String variant)
Sets the calendar variant.
|
ChronoFormatter<T> |
withCalendarVariant(VariantSource variantSource)
Sets the calendar variant.
|
<V> ChronoFormatter<T> |
withDefault(ChronoElement<V> element,
V value)
Determines a default replacement value for given element.
|
ChronoFormatter<T> |
withGregorianCutOver(PlainDate date)
Short-cut for
with(ChronoHistory.ofGregorianReform(date)). |
ChronoFormatter<T> |
withLatinEraNames()
Creates a copy of this formatter with latin era names.
|
ChronoFormatter<T> |
withStdTimezone()
Equivalent to
with(Timezone.ofSystem()). |
ChronoFormatter<T> |
withTimezone(String tzid)
Equivalent to
with(Timezone.of(tzid)). |
ChronoFormatter<T> |
withTimezone(TZID tzid)
Equivalent to
with(Timezone.of(tzid)). |
public Chronology<T> getChronology()
Returns the associated chronology.
public Locale getLocale()
Returns the locale setting.
If there is just a reference to ISO-8601 without any concrete
language then this method will yield Locale.ROOT.
null)public AttributeQuery getAttributes()
Returns the global format attributes which are active if they are not overridden by sectional attributes.
These attributes can be adjusted by a suitable
with()-method. Following attributes are predefined:
Attributes.CALENDAR_TYPE |
read-only, dependent on associated chronology |
Attributes.LANGUAGE |
dependent on associated locale |
Attributes.DECIMAL_SEPARATOR |
dependent on associated locale |
Attributes.ZERO_DIGIT |
dependent on associated locale |
Attributes.LENIENCY |
Leniency.SMART |
Attributes.PARSE_CASE_INSENSITIVE |
true |
Attributes.PARSE_PARTIAL_COMPARE |
false |
Attributes.TEXT_WIDTH |
TextWidth.WIDE |
Attributes.OUTPUT_CONTEXT |
OutputContext.FORMAT |
Attributes.PAD_CHAR |
(SPACE) |
getAttributes in interface TemporalFormatter<T extends ChronoEntity<T>>ChronoFormatter.getChronology(),
ChronoFormatter.getLocale()public String format(T formattable)
format in interface TemporalFormatter<T extends ChronoEntity<T>>public String format(GeneralTimestamp<?> tsp)
Prints given general timestamp.
tsp - general timestamp as combination of a date and a timeIllegalArgumentException - if the timestamp is not formattable with this formatterpublic void formatToBuffer(T formattable, Appendable buffer) throws IOException
formatToBuffer in interface TemporalFormatter<T extends ChronoEntity<T>>IOExceptionpublic Set<ElementPosition> print(T formattable, StringBuilder buffer)
Prints given chronological entity as formatted text and writes the text into given buffer.
Equiovalent to
print(formattable, buffer, getDefaultAttributes(), true).
formattable - object to be formattedbuffer - text output bufferIllegalArgumentException - if given object is not formattablepublic Set<ElementPosition> print(T formattable, Appendable buffer, AttributeQuery attributes) throws IOException
Prints given chronological entity as formatted text and writes the text into given buffer.
The given attributes cannot change the inner format structure (for example not change a localized weekmodel), but can override some format properties like language or certain text attributes for this run only.
Equivalent to
print(formattable, buffer, attributes, true).
formattable - object to be formattedbuffer - text output bufferattributes - attributes for limited formatting controlIllegalArgumentException - if given object is not formattableIOException - if writing to buffer failspublic <R> R print(T formattable, Appendable buffer, AttributeQuery attributes, ChronoFunction<ChronoDisplay,R> query) throws IOException
ChronoPrinterCreates a text output and writes it into given buffer.
Note: Implementations have to call query.apply(...)
at the end to return a possibly meaningful result. An example
would be a query which produces just the identical input so
the result of printing a Moment will be the formatted
form of the original Moment.
print in interface ChronoPrinter<T extends ChronoEntity<T>>R - generic result typeformattable - chronological entity to be formattedbuffer - format buffer any text output will be sent toattributes - control attributesquery - custom query returning any kind of resultIOException - if writing into buffer failspublic T parse(CharSequence text) throws ParseException
parse in interface TemporalFormatter<T extends ChronoEntity<T>>ParseExceptionpublic T parse(CharSequence text, ParsePosition position)
For maximum information use ChronoFormatter.parse(CharSequence, ParseLog) instead.
parse in interface TemporalFormatter<T extends ChronoEntity<T>>text - text to be parsedposition - parse position (always as new instance)null if parsing does not workIndexOutOfBoundsException - if the start position is at end of text or even behindpublic T parse(CharSequence text, ParsePosition position, RawValues rawValues)
parse in interface TemporalFormatter<T extends ChronoEntity<T>>public T parse(CharSequence text, ParseLog status)
Interpretes given text as chronological entity starting at the specified position in parse log.
Equivalent to parse(text, status, getDefaultAttributes()).
text - text to be parsedstatus - parser information (always as new instance)null if parsing does not workIndexOutOfBoundsException - if the start position is at end of
text or even behindpublic T parse(CharSequence text, ParseLog status, AttributeQuery attributes)
Interpretes given text as chronological entity starting at the specified position in parse log.
The given attributes cannot change the inner format structure (for example not change a localized weekmodel), but can override some format properties like expected language or certain text attributes for this run only.
parse in interface ChronoParser<T extends ChronoEntity<T>>text - text to be parsedstatus - parser information (always as new instance)attributes - attributes for limited parsing controlnull if parsing does not workIndexOutOfBoundsException - if the start position is at end of text or even behindpublic ChronoEntity<?> parseRaw(String text)
Translates given text as raw chronological entity without converting to the target type of the underlying chronology.
text - text to be parsedpublic ChronoEntity<?> parseRaw(CharSequence text, int offset)
Translates given text as raw chronological entity without converting to the target type of the underlying chronology.
text - text to be parsedoffset - start positionpublic ChronoFormatter<T> with(Locale locale)
Creates a copy of this formatter with given locale.
Note: Sectional attributes will never be overridden. Is the locale not changed then the method will simply return this instance. Otherwise the copy will contain given locale and also adjusts the associated numerical symbols:
If necessary all inner format elements which are locale-dependent
will also be adjusted. Some country-specific extensions like
Weekmodel.weekOfYear() or ChronoHistory.era()
will only be adjusted if the country-part of given locale is not empty.
However, fixed literals will remain unchanged hence this method might
not be suitable for all languages. Example:
new Locale("sv") will only change the language to swedish
with no side effects, but new Locale("sv", "SE") will also
set the week model and the historical swedish calendar which can be
relevant for the years 1700-1712.
with in interface TemporalFormatter<T extends ChronoEntity<T>>locale - new language and country configurationpublic ChronoFormatter<T> with(Leniency leniency)
with in interface TemporalFormatter<T extends ChronoEntity<T>>public ChronoFormatter<T> withAlternativeEraNames()
Creates a copy of this formatter with alternative era names.
Note: Sectional attributes cannot be overridden.
HistoricEra.getAlternativeName(Locale, TextWidth)public ChronoFormatter<T> withLatinEraNames()
Creates a copy of this formatter with latin era names.
Note: Sectional attributes cannot be overridden.
public ChronoFormatter<T> withGregorianCutOver(PlainDate date)
Short-cut for with(ChronoHistory.ofGregorianReform(date)).
date - first gregorian date after gregorian calendar reform takes effectIllegalArgumentException - if given date is before first introduction of gregorian calendar
on 1582-10-15 and not the minimum on the date axisChronoHistory.ofGregorianReform(PlainDate),
ChronoFormatter.with(ChronoHistory)public ChronoFormatter<T> with(ChronoHistory history)
Creates a copy of this formatter with the given chronological history of gregorian calendar reforms.
Note that this configuration will override any gregorian cutover date which might be inferred from current locale.
history - chronological history describing historical calendar reformspublic ChronoFormatter<T> with(Timezone tz)
Creates a copy of this formatter with given timezone which shall be used in formatting or parsing.
The timezone is in most cases only relevant for the type
Moment. When formatting the timezone helps
to convert the UTC value into a zonal representation. When
parsing the timezone serves as replacement value if the formatted
text does not contain any timezone.
tz - timezoneAttributes.TIMEZONE_ID,
Attributes.TRANSITION_STRATEGYpublic ChronoFormatter<T> withTimezone(TZID tzid)
Equivalent to with(Timezone.of(tzid)).
withTimezone in interface TemporalFormatter<T extends ChronoEntity<T>>tzid - timezone idpublic ChronoFormatter<T> withTimezone(String tzid)
Equivalent to with(Timezone.of(tzid)).
withTimezone in interface TemporalFormatter<T extends ChronoEntity<T>>tzid - timezone idIllegalArgumentException - if given timezone cannot be loadedpublic ChronoFormatter<T> withStdTimezone()
Equivalent to with(Timezone.ofSystem()).
public ChronoFormatter<T> withCalendarVariant(String variant)
Sets the calendar variant.
Some calendars like HijriCalendar require the variant otherwise they cannot be
successfully parsed.
variant - name of new calendar variantAttributes.CALENDAR_VARIANTpublic ChronoFormatter<T> withCalendarVariant(VariantSource variantSource)
Sets the calendar variant.
Some calendars like HijriCalendar require the variant otherwise they cannot be
successfully parsed.
variantSource - source of new calendar variantAttributes.CALENDAR_VARIANTpublic ChronoFormatter<T> with(StartOfDay startOfDay)
Sets the start of calendar day.
startOfDay - new start of dayAttributes.START_OF_DAYpublic <V> ChronoFormatter<T> withDefault(ChronoElement<V> element, V value)
Determines a default replacement value for given element.
Example:
ChronoFormatter<PlainDate> fmt =
PlainDate.localFormatter("MM-dd", PatternType.CLDR)
.withDefault(PlainDate.YEAR, 2012);
PlainDate date = fmt.parse("05-21");
System.out.println(date); // 2012-05-21
Default replacement values will be considered by Time4J if either
the formatter does not contain the element in question at all or if
there are no consumable characters for given element. Latter
situation might sometimes require the use of sectional attribute
PROTECTED_CHARACTERS in order to simulate an end-of-text
situation.
V - generic element value typeelement - chronological element to be updatedvalue - replacement value or null
if the default value shall be deregisteredIllegalArgumentException - if given element is not supported
by the underlying chronologyAttributes.PROTECTED_CHARACTERSpublic ChronoFormatter<T> with(AttributeKey<Boolean> key, boolean value)
Creates a copy of this formatter with given boolean-attribute.
Note: Sectional attributes cannot be overridden.
key - attribute keyvalue - attribute valuepublic ChronoFormatter<T> with(AttributeKey<Integer> key, int value)
Creates a copy of this formatter with given int-attribute.
Note: Sectional attributes cannot be overridden.
key - attribute keyvalue - attribute valuepublic ChronoFormatter<T> with(AttributeKey<Character> key, char value)
Creates a copy of this formatter with given char-attribute.
Note: Sectional attributes cannot be overridden.
key - attribute keyvalue - attribute valuepublic <A extends Enum<A>> ChronoFormatter<T> with(AttributeKey<A> key, A value)
Creates a copy of this formatter with given enum-attribute.
Note: Sectional attributes cannot be overridden.
A - generic attribute value typekey - attribute keyvalue - attribute valuepublic ChronoFormatter<T> with(Attributes attributes)
Creates a copy of this formatter with given standard attributes.
Note: Sectional attributes cannot be overridden.
attributes - new default attributespublic Format toFormat()
Converts this formatter into a traditional
java.text.Format-object.
The returned format object also supports attributed strings such
that all ChronoElement-structures are associated with field
attributes of type DateFormat.Field.
In ISO systems following mapping will be applied:
PlainTime.AM_PM_OF_DAY =>
DateFormat.Field.AM_PMPlainTime.CLOCK_HOUR_OF_AMPM =>
DateFormat.Field.HOUR1PlainTime.CLOCK_HOUR_OF_DAY =>
DateFormat.Field.HOUR_OF_DAY1PlainDate.DAY_OF_MONTH =>
DateFormat.Field.DAY_OF_MONTHPlainDate.DAY_OF_WEEK =>
DateFormat.Field.DAY_OF_WEEKPlainDate.DAY_OF_YEAR =>
DateFormat.Field.DAY_OF_YEARPlainTime.DIGITAL_HOUR_OF_AMPM =>
DateFormat.Field.HOUR1PlainTime.DIGITAL_HOUR_OF_DAY =>
DateFormat.Field.HOUR0PlainTime.MILLI_OF_SECOND =>
DateFormat.Field.MILLISECONDPlainTime.MINUTE_OF_HOUR =>
DateFormat.Field.MINUTEPlainDate.MONTH_AS_NUMBER =>
DateFormat.Field.MONTHPlainDate.MONTH_OF_YEAR =>
DateFormat.Field.MONTHPlainTime.SECOND_OF_MINUTE =>
DateFormat.Field.SECONDPlainDate.WEEKDAY_IN_MONTH =>
DateFormat.Field.DAY_OF_WEEK_IN_MONTHPlainDate.YEAR =>
DateFormat.Field.YEARPlainDate.YEAR_OF_WEEKDATE =>
DateFormat.Field.YEARWeekmodel.boundedWeekOfMonth() =>
DateFormat.Field.WEEK_OF_MONTHWeekmodel.boundedWeekOfYear() =>
DateFormat.Field.WEEK_OF_YEARWeekmodel.weekOfMonth() =>
DateFormat.Field.WEEK_OF_MONTHWeekmodel.weekOfYear() =>
DateFormat.Field.WEEK_OF_YEARWeekmodel.localDayOfWeek() =>
DateFormat.Field.DAY_OF_WEEKChronoEntity.getTimezone() =>
DateFormat.Field.TIME_ZONEChronoHistory.era() =>
DateFormat.Field.ERAChronoHistory.yearOfEra() =>
DateFormat.Field.YEARChronoHistory.month() =>
DateFormat.Field.MONTHChronoHistory.dayOfMonth() =>
DateFormat.Field.DAY_OF_MONTHNote: The returned Format-object is not serializable.
java.text.Format-object which
delegates all formatting and parsing work to this instancepublic static ChronoFormatter<PlainDate> ofDatePattern(String pattern, PatternType type, Locale locale)
Constructs a pattern-based formatter for plain date objects.
pattern - format patterntype - the type of the pattern to be usedlocale - format localeChronoFormatter-instanceIllegalArgumentException - if resolving of pattern failspublic static ChronoFormatter<PlainTime> ofTimePattern(String pattern, PatternType type, Locale locale)
Constructs a pattern-based formatter for clock time objects.
pattern - format patterntype - the type of the pattern to be usedlocale - format localeChronoFormatter-instanceIllegalArgumentException - if resolving of pattern failspublic static ChronoFormatter<PlainTimestamp> ofTimestampPattern(String pattern, PatternType type, Locale locale)
Constructs a pattern-based formatter for plain timestamps.
pattern - format patterntype - the type of the pattern to be usedlocale - format localeChronoFormatter-instanceIllegalArgumentException - if resolving of pattern failspublic static ChronoFormatter<Moment> ofMomentPattern(String pattern, PatternType type, Locale locale, TZID tzid)
Constructs a pattern-based formatter for global timestamp objects.
pattern - format patterntype - the type of the pattern to be usedlocale - format localetzid - timezone idMoment-objects using given locale and timezoneIllegalArgumentException - if resolving of pattern failspublic static <T extends ChronoEntity<T> & LocalizedPatternSupport> ChronoFormatter<T> ofPattern(String pattern, PatternType type, Locale locale, Chronology<T> chronology)
Constructs a pattern-based formatter for general chronologies.
This method is only applicable on chronologies which support CLDR-compatible format patterns.
T - generic chronological typepattern - format patterntype - the type of the pattern to be usedlocale - format localechronology - chronology with format pattern supportChronoFormatter-instanceIllegalArgumentException - if resolving of pattern failsChronoFormatter.Builder.addPattern(String, PatternType)public static ChronoFormatter<PlainDate> ofDateStyle(DisplayMode style, Locale locale)
Constructs a style-based formatter for plain date objects.
style - format stylelocale - format localeChronoFormatter-instanceCalendarText.patternForDate(DisplayMode, Locale)public static ChronoFormatter<PlainTime> ofTimeStyle(DisplayMode style, Locale locale)
Constructs a style-based formatter for plain date objects.
style - format stylelocale - format localeChronoFormatter-instanceCalendarText.patternForTime(DisplayMode, Locale)public static ChronoFormatter<PlainTimestamp> ofTimestampStyle(DisplayMode dateStyle, DisplayMode timeStyle, Locale locale)
Constructs a style-based formatter for plain timestamps.
dateStyle - format style of date parttimeStyle - format style of time partlocale - format localeChronoFormatter-instanceCalendarText.patternForTimestamp(DisplayMode, DisplayMode, Locale)public static ChronoFormatter<Moment> ofMomentStyle(DisplayMode dateStyle, DisplayMode timeStyle, Locale locale, TZID tzid)
Constructs a style-based formatter for moments.
dateStyle - format style of date parttimeStyle - format style of time partlocale - format localetzid - timezone identifierChronoFormatter-instanceCalendarText.patternForMoment(DisplayMode, DisplayMode, Locale)public static <T extends ChronoEntity<T> & LocalizedPatternSupport> ChronoFormatter<T> ofStyle(DisplayStyle style, Locale locale, Chronology<T> chronology)
Constructs a style-based formatter for general chronologies.
T - generic chronological typestyle - format stylelocale - format localechronology - chronology with format pattern supportChronoFormatter-instanceUnsupportedOperationException - if given style is not supportedDisplayModepublic static <T extends ChronoEntity<T>> ChronoFormatter.Builder<T> setUp(Class<T> type, Locale locale)
Constructs a builder for creating formatters.
T - generic chronological type (subtype of ChronoEntity)type - reified chronological typelocale - format localeBuilder-instanceIllegalArgumentException - if given chronological type is not
formattable that is if no chronology can be derived from typeChronology.lookup(Class)public static <T extends ChronoEntity<T>> ChronoFormatter.Builder<T> setUp(Chronology<T> chronology, Locale locale)
Constructs a builder for creating formatters.
T - generic chronological type (subtype of ChronoEntity)chronology - formattable chronologylocale - format localeBuilder-instancepublic static <C extends CalendarVariant<C>> ChronoFormatter.Builder<Moment> setUpWithOverride(Locale locale, CalendarFamily<C> overrideCalendar)
Constructs a builder for creating global formatters with usage of given calendar type.
For formatting, it is necessary to set the timezone on the built formatter. For parsing, the calendar variant is necessary.
C - generic calendrical type with variantlocale - format localeoverrideCalendar - formattable calendar chronologyBuilder-instance applicable on Momentpublic static <C extends Calendrical<?,C>> ChronoFormatter.Builder<Moment> setUpWithOverride(Locale locale, Chronology<C> overrideCalendar)
Constructs a builder for creating global formatters with usage of given calendar type.
For formatting, it is necessary to set the timezone on the built formatter.
C - generic calendrical typelocale - format localeoverrideCalendar - formattable calendar chronologyBuilder-instance applicable on Momentpublic boolean equals(Object obj)
Compares the chronologies, default attributes, default values and the internal format structures.
Copyright © 2014–2016. All rights reserved.