org.joda.time.convert
Interface PartialConverter
- Converter
public interface PartialConverter
PartialConverter defines how an object is converted to a ReadablePartial.
The two methods in this interface must be called in order, as the
getPartialValues
method relies on the result of the
getChronology
method being passed in.
getChronology
public Chronology getChronology(Object object,
Chronology chrono)
Extracts the chronology from an object of this converter's type
where the chronology is specified.
object
- the object to convertchrono
- the chronology to use, null usually means ISO
- the chronology, not converted to UTC/local time zone, must be non-null valid
getChronology
public Chronology getChronology(Object object,
DateTimeZone zone)
Extracts the chronology from an object of this converter's type
where the time zone is specified.
object
- the object to convertzone
- the specified zone to use, null means default zone
- the chronology, never null
getPartialValues
public int[] getPartialValues(ReadablePartial fieldSource,
Object object,
Chronology chrono)
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.
fieldSource
- a partial that provides access to the fields.
This partial may be incomplete and only getFieldType(int) should be usedobject
- the object to convertchrono
- 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
getPartialValues
public int[] getPartialValues(ReadablePartial fieldSource,
Object object,
Chronology chrono,
DateTimeFormatter parser)
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.
fieldSource
- a partial that provides access to the fields.
This partial may be incomplete and only getFieldType(int) should be usedobject
- the object to convertchrono
- the chronology to use, which is the non-null result of getChronology()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
Copyright (c) 2001-2006 - Joda.org