/** * Convert the specified text and locale into a value. * * @param text the text to convert * @param locale the locale to convert using * @return the value extracted from the text * @throws IllegalArgumentException if the text is invalid */ protected int convertText(String text, Locale locale) { try { return Integer.parseInt(text); } catch (NumberFormatException ex) { throw new IllegalFieldValueException(getType(), text); } }
/** * Convert the specified text and locale into a value. * * @param text the text to convert * @param locale the locale to convert using * @return the value extracted from the text * @throws IllegalArgumentException if the text is invalid */ protected int convertText(String text, Locale locale) { try { return Integer.parseInt(text); } catch (NumberFormatException ex) { throw new IllegalFieldValueException(getType(), text); } }
/** * Get the human-readable, text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsText(ReadablePartial partial, Locale locale) { return getAsText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, short text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsShortText(ReadablePartial partial, Locale locale) { return getAsShortText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsText(ReadablePartial partial, Locale locale) { return getAsText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, short text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsShortText(ReadablePartial partial, Locale locale) { return getAsShortText(partial, partial.get(getType()), locale); }
/** * Convert the specified text and locale into a value. * * @param text the text to convert * @param locale the locale to convert using * @return the value extracted from the text * @throws IllegalArgumentException if the text is invalid */ protected int convertText(String text, Locale locale) { try { return Integer.parseInt(text); } catch (NumberFormatException ex) { throw new IllegalFieldValueException(getType(), text); } }
/** * Get the human-readable, text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsText(ReadablePartial partial, Locale locale) { return getAsText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, short text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsShortText(ReadablePartial partial, Locale locale) { return getAsShortText(partial, partial.get(getType()), locale); }
/** * Convert the specified text and locale into a value. * * @param text the text to convert * @param locale the locale to convert using * @return the value extracted from the text * @throws IllegalArgumentException if the text is invalid */ protected int convertText(String text, Locale locale) { try { return Integer.parseInt(text); } catch (NumberFormatException ex) { throw new IllegalFieldValueException(getType(), text); } }
/** * Get the human-readable, short text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsShortText(ReadablePartial partial, Locale locale) { return getAsShortText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, short text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsShortText(ReadablePartial partial, Locale locale) { return getAsShortText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, short text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsShortText(ReadablePartial partial, Locale locale) { return getAsShortText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsText(ReadablePartial partial, Locale locale) { return getAsText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsText(ReadablePartial partial, Locale locale) { return getAsText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, short text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsShortText(ReadablePartial partial, Locale locale) { return getAsShortText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsText(ReadablePartial partial, Locale locale) { return getAsText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsText(ReadablePartial partial, Locale locale) { return getAsText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, short text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsShortText(ReadablePartial partial, Locale locale) { return getAsShortText(partial, partial.get(getType()), locale); }
/** * Get the human-readable, text value of this field from a partial instant. * If the specified locale is null, the default locale is used. * <p> * The default implementation calls {@link ReadablePartial#get(DateTimeFieldType)} * and {@link #getAsText(ReadablePartial, int, Locale)}. * * @param partial the partial instant to query * @param locale the locale to use for selecting a text symbol, null for default * @return the text value of the field */ public final String getAsText(ReadablePartial partial, Locale locale) { return getAsText(partial, partial.get(getType()), locale); }