private TextAccessor accessor( Locale language, TextWidth textWidth, OutputContext outputContext ) { return CalendarText.getIsoInstance(language).getMeridiems(textWidth, outputContext); }
@Override public String getFormatPattern( DisplayStyle style, Locale locale ) { Map<String, String> map = CalendarText.getIsoInstance(locale).getTextForms(); String key = "F_y"; return (map.containsKey(key) ? map.get(key) : "uuuu"); }
@Override public String getDisplayName(Locale language) { String lname = CalendarText.getIsoInstance(language).getTextForms().get("L_weekday"); return ((lname == null) ? this.name() : lname); }
@Override public String getDisplayName(Locale language) { String lname = CalendarText.getIsoInstance(language).getTextForms().get("L_week"); return ((lname == null) ? this.name() : lname); }
@Override public String getDisplayName(Locale language) { String lname = CalendarText.getIsoInstance(language).getTextForms().get("L_dayperiod"); return ((lname == null) ? this.name() : lname); }
private TextAccessor accessor( Locale language, TextWidth tw, OutputContext oc ) { switch (this.index) { case MONTH: return CalendarText.getIsoInstance(language).getStdMonths(tw, oc); case DAY_OF_WEEK: return CalendarText.getIsoInstance(language).getWeekdays(tw, oc); case QUARTER_OF_YEAR: return CalendarText.getIsoInstance(language).getQuarters(tw, oc); default: throw new UnsupportedOperationException(this.name()); } }
private static Map<String, String> loadTextForms( Locale locale, String calendarType ) { Map<String, String> map = CalendarText.getInstance(calendarType, locale).getTextForms(); if ( !calendarType.equals(CalendarText.ISO_CALENDAR_TYPE) && !"true".equals(map.get("hasDayPeriods")) ) { map = CalendarText.getIsoInstance(locale).getTextForms(); // fallback } return map; }
Weekday wd = CalendarText.getIsoInstance(locale).getWeekdays(width, context).parse(text, pp, Weekday.class);
Meridiem m = CalendarText.getIsoInstance(locale).getMeridiems(width, context).parse(text, pp, Meridiem.class);
Quarter q = CalendarText.getIsoInstance(locale).getQuarters(width, context).parse(text, pp, Quarter.class);
Month m = CalendarText.getIsoInstance(locale).getStdMonths(width, context).parse(text, pp, Month.class);
private TextAccessor accessor( AttributeQuery attributes, OutputContext oc ) { CalendarText cnames = CalendarText.getIsoInstance(attributes.get(Attributes.LANGUAGE, Locale.ROOT)); return cnames.getWeekdays( attributes.get(Attributes.TEXT_WIDTH, TextWidth.WIDE), oc); }
) { return CalendarText.getIsoInstance(locale).getWeekdays(width, context).print(this);
) { return CalendarText.getIsoInstance(locale).getStdMonths(width, context).print(this);
) { return CalendarText.getIsoInstance(locale).getMeridiems(width, context).print(this);
) { return CalendarText.getIsoInstance(locale).getQuarters(width, context).print(this);
private TextAccessor accessor(AttributeQuery attributes) { CalendarText cnames = CalendarText.getIsoInstance(attributes.get(Attributes.LANGUAGE, Locale.ROOT)); TextWidth textWidth = attributes.get(Attributes.TEXT_WIDTH, TextWidth.WIDE); OutputContext outputContext = attributes.get(Attributes.OUTPUT_CONTEXT, OutputContext.FORMAT); return cnames.getMeridiems(textWidth, outputContext); }
@Override public String getFormatPattern( DisplayStyle style, Locale locale ) { Map<String, String> map = CalendarText.getIsoInstance(locale).getTextForms(); String key = null; switch (style.getStyleValue()) { case DateFormat.FULL: key = "F_yMMMM"; break; case DateFormat.LONG: key = "F_yMMM"; break; case DateFormat.MEDIUM: key = "F_yMM"; break; case DateFormat.SHORT: key = "F_yM"; break; } String pattern = getFormatPattern(map, key); return ((pattern == null) ? "uuuu-MM" : pattern); }
@Override public String getFormatPattern( DisplayStyle style, Locale locale ) { Map<String, String> map = CalendarText.getIsoInstance(locale).getTextForms(); String key = null; switch (style.getStyleValue()) { case DateFormat.FULL: key = "F_yQQQQ"; break; case DateFormat.LONG: key = "F_yQQQ"; break; case DateFormat.MEDIUM: key = "F_yQQ"; break; case DateFormat.SHORT: key = "F_yQ"; break; } String pattern = getFormatPattern(map, key); return ((pattern == null) ? "uuuu-'Q'Q" : pattern); }
String lname = CalendarText.getIsoInstance(language).getTextForms().get(key); return ((lname == null) ? this.name() : lname);