| java.lang.Object org.joda.time.convert.AbstractConverter
All known Subclasses: org.joda.time.convert.LongConverter, org.joda.time.convert.NullConverter, org.joda.time.convert.StringConverter, org.joda.time.convert.ReadableIntervalConverter, org.joda.time.convert.ReadableInstantConverter, org.joda.time.convert.DateConverter, org.joda.time.convert.CalendarConverter, org.joda.time.convert.ReadableDurationConverter, org.joda.time.convert.ReadablePartialConverter, org.joda.time.convert.ReadablePeriodConverter,
AbstractConverter | abstract public class AbstractConverter implements Converter(Code) | | AbstractConverter simplifies the process of implementing a converter.
author: Stephen Colebourne since: 1.0 |
AbstractConverter | protected AbstractConverter()(Code) | | Restricted constructor.
|
getChronology | public Chronology getChronology(Object object, DateTimeZone zone)(Code) | | Extracts the chronology from an object of this convertor's type
where the time zone is specified.
This implementation returns the ISO chronology.
Parameters: object - the object to convert Parameters: zone - the specified zone to use, null means default zone the chronology, never null |
getChronology | public Chronology getChronology(Object object, Chronology chrono)(Code) | | Extracts the chronology from an object of this convertor's type
where the chronology is specified.
This implementation returns the chronology specified, or the
ISO chronology in the default zone if null passed in.
Parameters: object - the object to convert Parameters: chrono - the chronology to use, null means ISO default the chronology, never null |
getInstantMillis | public long getInstantMillis(Object object, Chronology chrono)(Code) | | Extracts the millis from an object of this convertor's type.
This implementation returns the current time.
Parameters: object - the object to convert Parameters: chrono - the chronology to use, which is always non-null the millisecond value |
getPartialValues | public int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono)(Code) | | Extracts the values of the partial from an object of this converter's type.
The chrono parameter is a hint to the converter, should it require a
chronology to aid in conversion.
This implementation calls
AbstractConverter.getInstantMillis(Object,Chronology) .
Parameters: fieldSource - a partial that provides access to the fields.This partial may be incomplete and only getFieldType(int) should be used Parameters: object - the object to convert Parameters: chrono - the chronology to use, which is the non-null result of getChronology() the array of field values that match the fieldSource, must be non-null valid throws: ClassCastException - if the object is invalid |
getPartialValues | public int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono, DateTimeFormatter parser)(Code) | | Extracts the values of the partial from an object of this converter's type.
The chrono parameter is a hint to the converter, should it require a
chronology to aid in conversion.
This implementation calls
AbstractConverter.getPartialValues(ReadablePartial,Object,Chronology) .
Parameters: fieldSource - a partial that provides access to the fields.This partial may be incomplete and only getFieldType(int) should be used Parameters: object - the object to convert Parameters: chrono - the chronology to use, which is the non-null result of getChronology() Parameters: parser - if converting from a String, the given parser is preferred the array of field values that match the fieldSource, must be non-null valid throws: ClassCastException - if the object is invalid since: 1.3 |
getPeriodType | public PeriodType getPeriodType(Object object)(Code) | | Selects a suitable period type for the given object.
Parameters: object - the object to examine the period type, never null |
isReadableInterval | public boolean isReadableInterval(Object object, Chronology chrono)(Code) | | Checks if the input is a ReadableInterval.
If it is, then the calling code should cast and copy the fields directly.
Parameters: object - the object to convert Parameters: chrono - the chronology to use, may be null true if the input is a ReadableInterval |
toString | public String toString()(Code) | | Gets a debugging string version of this converter.
a debugging string |
|
|