public interface

PartialConverter

implements Converter
org.joda.time.convert.PartialConverter

Class Overview

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.

Summary

Public Methods
abstract Chronology getChronology(Object object, Chronology chrono)
Extracts the chronology from an object of this converter's type where the chronology is specified.
abstract Chronology getChronology(Object object, DateTimeZone zone)
Extracts the chronology from an object of this converter's type where the time zone is specified.
abstract int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono, DateTimeFormatter parser)
Extracts the values of the partial from an object of this converter's type.
abstract int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono)
Extracts the values of the partial from an object of this converter's type.
[Expand]
Inherited Methods
From interface org.joda.time.convert.Converter

Public Methods

public abstract Chronology getChronology (Object object, Chronology chrono)

Extracts the chronology from an object of this converter's type where the chronology is specified.

Parameters
object the object to convert
chrono the chronology to use, null usually means ISO
Returns
  • the chronology, not converted to UTC/local time zone, must be non-null valid
Throws
ClassCastException if the object is invalid

public abstract Chronology getChronology (Object object, DateTimeZone zone)

Extracts the chronology from an object of this converter's type where the time zone is specified.

Parameters
object the object to convert
zone the specified zone to use, null means default zone
Returns
  • the chronology, never null
Throws
ClassCastException if the object is invalid

public abstract 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.

Parameters
fieldSource a partial that provides access to the fields. This partial may be incomplete and only getFieldType(int) should be used
object the object to convert
chrono the chronology to use, which is the non-null result of getChronology()
parser if converting from a String, the given parser is preferred
Returns
  • the array of field values that match the fieldSource, must be non-null valid
Throws
ClassCastException if the object is invalid

public abstract 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.

Parameters
fieldSource a partial that provides access to the fields. This partial may be incomplete and only getFieldType(int) should be used
object the object to convert
chrono the chronology to use, which is the non-null result of getChronology()
Returns
  • the array of field values that match the fieldSource, must be non-null valid
Throws
ClassCastException if the object is invalid