/** * Restricted constructor */ GJEraDateTimeField(BasicChronology chronology) { super(DateTimeFieldType.era()); iChronology = chronology; }
/** * Restricted constructor. */ BasicSingleEraDateTimeField(String text) { super(DateTimeFieldType.era()); iEraText = text; }
/** * Restricted constructor */ GJEraDateTimeField(BasicChronology chronology) { super(DateTimeFieldType.era()); iChronology = chronology; }
/** * Restricted constructor. */ BasicSingleEraDateTimeField(String text) { super(DateTimeFieldType.era()); iEraText = text; }
/** @inheritDoc */ public long set(long instant, String text, Locale locale) { if (iEraText.equals(text) == false && "1".equals(text) == false) { throw new IllegalFieldValueException(DateTimeFieldType.era(), text); } return instant; }
/** * Instructs the printer to emit a locale-specific era text (BC/AD), and * the parser to expect it. The parser is case-insensitive. * * @return this DateTimeFormatterBuilder, for chaining */ public DateTimeFormatterBuilder appendEraText() { return appendText(DateTimeFieldType.era()); }
public int eraTextToValue(String text) { Integer era = iParseEras.get(text); if (era != null) { return era.intValue(); } throw new IllegalFieldValueException(DateTimeFieldType.era(), text); }
/** * Instructs the printer to emit a locale-specific era text (BC/AD), and * the parser to expect it. The parser is case-insensitive. * * @return this DateTimeFormatterBuilder, for chaining */ public DateTimeFormatterBuilder appendEraText() { return appendText(DateTimeFieldType.era()); }
public int eraTextToValue(String text) { Integer era = iParseEras.get(text); if (era != null) { return era.intValue(); } throw new IllegalFieldValueException(DateTimeFieldType.era(), text); }
/** @inheritDoc */ public long set(long instant, String text, Locale locale) { if (iEraText.equals(text) == false && "1".equals(text) == false) { throw new IllegalFieldValueException(DateTimeFieldType.era(), text); } return instant; }
protected void appendEraText() { builder.appendEraText(); appendTextField(DateTimeFieldType.era(), false); } protected void appendCenturyOfEra(int minDigits, int maxDigits) {
/** * Get the era field for this chronology. * * @return DateTimeField or UnsupportedDateTimeField if unsupported */ public DateTimeField era() { return UnsupportedDateTimeField.getInstance(DateTimeFieldType.era(), eras()); }
/** * Get the era field for this chronology. * * @return DateTimeField or UnsupportedDateTimeField if unsupported */ public DateTimeField era() { return UnsupportedDateTimeField.getInstance(DateTimeFieldType.era(), eras()); }
validValues.put(property.getAsText(locale).toUpperCase(locale), Boolean.TRUE); if ("en".equals(locale.getLanguage()) && iFieldType == DateTimeFieldType.era()) {
validValues.put(property.getAsText(locale).toUpperCase(locale), Boolean.TRUE); if ("en".equals(locale.getLanguage()) && iFieldType == DateTimeFieldType.era()) {
private void initBase() { if (era >= 0 ) base = JodaTimeUtils.setField(base, DateTimeFieldType.era(), era); if (year >= 0) base = JodaTimeUtils.setField(base, DateTimeFieldType.year(), year); if (month >= 0) base = JodaTimeUtils.setField(base, DateTimeFieldType.monthOfYear(), month); if (day >= 0) base = JodaTimeUtils.setField(base, DateTimeFieldType.dayOfMonth(), day); }
/** * Restricted constructor */ GJEraDateTimeField(BasicChronology chronology) { super(DateTimeFieldType.era()); iChronology = chronology; }
/** * Instructs the printer to emit a locale-specific era text (BC/AD), and * the parser to expect it. The parser is case-insensitive. * * @return this DateTimeFormatterBuilder, for chaining */ public DateTimeFormatterBuilder appendEraText() { return appendText(DateTimeFieldType.era()); }
/** @inheritDoc */ public long set(long instant, String text, Locale locale) { if (iEraText.equals(text) == false && "1".equals(text) == false) { throw new IllegalFieldValueException(DateTimeFieldType.era(), text); } return instant; }