/** * Constructs a format object using the specified pattern and the date time * constants for the default locale. * * @param pattern string pattern specification */ protected DateTimeFormat(String pattern) { this(pattern, getDefaultDateTimeFormatInfo()); }
/** * Internal factory method that provides caching. * * @param pattern * @param dtfi * @return DateTimeFormat instance */ protected static DateTimeFormat getFormat(String pattern, DateTimeFormatInfo dtfi) { DateTimeFormatInfo defaultDtfi = getDefaultDateTimeFormatInfo(); DateTimeFormat dtf = null; if (dtfi == defaultDtfi) { dtf = cache.get(pattern); } if (dtf == null) { dtf = new DateTimeFormat(pattern, dtfi); if (dtfi == defaultDtfi) { cache.put(pattern, dtf); } } return dtf; }
/** * Returns a DateTimeFormat object using the specified pattern. If you need to * format or parse repeatedly using the same pattern, it is highly recommended * that you cache the returned <code>DateTimeFormat</code> object and reuse it * rather than calling this method repeatedly. * * <p>Note that the pattern supplied is used as-is -- for example, if you * supply "MM/dd/yyyy" as the pattern, that is the order you will get the * fields, even in locales where the order is different. It is recommended to * use {@link #getFormat(PredefinedFormat)} instead -- if you use this method, * you are taking responsibility for localizing the patterns yourself. * * @param pattern string to specify how the date should be formatted * * @return a <code>DateTimeFormat</code> object that can be used for format or * parse date/time values matching the specified pattern * * @throws IllegalArgumentException if the specified pattern could not be * parsed */ public static DateTimeFormat getFormat(String pattern) { return getFormat(pattern, getDefaultDateTimeFormatInfo()); }
/** * Constructs a format object using the specified pattern and the date time * constants for the default locale. * * @param pattern string pattern specification */ protected DateTimeFormat(String pattern) { this(pattern, getDefaultDateTimeFormatInfo()); }
/** * Constructs a format object using the specified pattern and the date time * constants for the default locale. * * @param pattern string pattern specification */ protected DateTimeFormat(String pattern) { this(pattern, getDefaultDateTimeFormatInfo()); }
/** * Internal factory method that provides caching. * * @param pattern * @param dtfi * @return DateTimeFormat instance */ protected static DateTimeFormat getFormat(String pattern, DateTimeFormatInfo dtfi) { DateTimeFormatInfo defaultDtfi = getDefaultDateTimeFormatInfo(); DateTimeFormat dtf = null; if (dtfi == defaultDtfi) { dtf = cache.get(pattern); } if (dtf == null) { dtf = new DateTimeFormat(pattern, dtfi); if (dtfi == defaultDtfi) { cache.put(pattern, dtf); } } return dtf; }
/** * Returns a DateTimeFormat object using the specified pattern. If you need to * format or parse repeatedly using the same pattern, it is highly recommended * that you cache the returned <code>DateTimeFormat</code> object and reuse it * rather than calling this method repeatedly. * * <p>Note that the pattern supplied is used as-is -- for example, if you * supply "MM/dd/yyyy" as the pattern, that is the order you will get the * fields, even in locales where the order is different. It is recommended to * use {@link #getFormat(PredefinedFormat)} instead -- if you use this method, * you are taking responsibility for localizing the patterns yourself. * * @param pattern string to specify how the date should be formatted * * @return a <code>DateTimeFormat</code> object that can be used for format or * parse date/time values matching the specified pattern * * @throws IllegalArgumentException if the specified pattern could not be * parsed */ public static DateTimeFormat getFormat(String pattern) { return getFormat(pattern, getDefaultDateTimeFormatInfo()); }
/** * Internal factory method that provides caching. * * @param pattern * @param dtfi * @return DateTimeFormat instance */ protected static DateTimeFormat getFormat(String pattern, DateTimeFormatInfo dtfi) { DateTimeFormatInfo defaultDtfi = getDefaultDateTimeFormatInfo(); DateTimeFormat dtf = null; if (dtfi == defaultDtfi) { dtf = cache.get(pattern); } if (dtf == null) { dtf = new DateTimeFormat(pattern, dtfi); if (dtfi == defaultDtfi) { cache.put(pattern, dtf); } } return dtf; }
/** * Returns a DateTimeFormat object using the specified pattern. If you need to * format or parse repeatedly using the same pattern, it is highly recommended * that you cache the returned <code>DateTimeFormat</code> object and reuse it * rather than calling this method repeatedly. * * <p>Note that the pattern supplied is used as-is -- for example, if you * supply "MM/dd/yyyy" as the pattern, that is the order you will get the * fields, even in locales where the order is different. It is recommended to * use {@link #getFormat(PredefinedFormat)} instead -- if you use this method, * you are taking responsibility for localizing the patterns yourself. * * @param pattern string to specify how the date should be formatted * * @return a <code>DateTimeFormat</code> object that can be used for format or * parse date/time values matching the specified pattern * * @throws IllegalArgumentException if the specified pattern could not be * parsed */ public static DateTimeFormat getFormat(String pattern) { return getFormat(pattern, getDefaultDateTimeFormatInfo()); }
DateTimeFormatInfo dtfi = getDefaultDateTimeFormatInfo(); String pattern; switch (predef) {
DateTimeFormatInfo dtfi = getDefaultDateTimeFormatInfo(); String pattern; switch (predef) {
DateTimeFormatInfo dtfi = getDefaultDateTimeFormatInfo(); String pattern; switch (predef) {