| java.lang.Object org.joda.time.convert.ConverterManager
ConverterManager | final public class ConverterManager (Code) | | ConverterManager controls the date and time converters.
This class enables additional conversion classes to be added via
ConverterManager.addInstantConverter(InstantConverter) , which may replace an
existing converter. Similar methods exist for duration, time period and
interval converters.
This class is threadsafe, so adding/removing converters can be done at any
time. Updating the set of convertors is relatively expensive, and so should
not be performed often.
The default instant converters are:
- ReadableInstant
- String
- Calendar
- Date (includes sql package subclasses)
- Long (milliseconds)
- null (now)
The default partial converters are:
- ReadablePartial
- ReadableInstant
- String
- Calendar
- Date (includes sql package subclasses)
- Long (milliseconds)
- null (now)
The default duration converters are:
- ReadableDuration
- ReadableInterval
- String
- Long (milliseconds)
- null (zero ms)
The default time period converters are:
- ReadablePeriod
- ReadableInterval
- String
- null (zero)
The default interval converters are:
- ReadableInterval
- String
- null (zero-length from now to now)
author: Stephen Colebourne author: Brian S O'Neill since: 1.0 |
ConverterManager | protected ConverterManager()(Code) | | Restricted constructor.
|
addDurationConverter | public DurationConverter addDurationConverter(DurationConverter converter) throws SecurityException(Code) | | Adds a converter to the set of converters. If a matching converter is
already in the set, the given converter replaces it. If the converter is
exactly the same as one already in the set, no changes are made.
The order in which converters are added is not relevent. The best
converter is selected by examining the object hierarchy.
Parameters: converter - the converter to add, null ignored replaced converter, or null |
addInstantConverter | public InstantConverter addInstantConverter(InstantConverter converter) throws SecurityException(Code) | | Adds a converter to the set of converters. If a matching converter is
already in the set, the given converter replaces it. If the converter is
exactly the same as one already in the set, no changes are made.
The order in which converters are added is not relevent. The best
converter is selected by examining the object hierarchy.
Parameters: converter - the converter to add, null ignored replaced converter, or null |
addIntervalConverter | public IntervalConverter addIntervalConverter(IntervalConverter converter) throws SecurityException(Code) | | Adds a converter to the set of converters. If a matching converter is
already in the set, the given converter replaces it. If the converter is
exactly the same as one already in the set, no changes are made.
The order in which converters are added is not relevent. The best
converter is selected by examining the object hierarchy.
Parameters: converter - the converter to add, null ignored replaced converter, or null |
addPartialConverter | public PartialConverter addPartialConverter(PartialConverter converter) throws SecurityException(Code) | | Adds a converter to the set of converters. If a matching converter is
already in the set, the given converter replaces it. If the converter is
exactly the same as one already in the set, no changes are made.
The order in which converters are added is not relevent. The best
converter is selected by examining the object hierarchy.
Parameters: converter - the converter to add, null ignored replaced converter, or null |
addPeriodConverter | public PeriodConverter addPeriodConverter(PeriodConverter converter) throws SecurityException(Code) | | Adds a converter to the set of converters. If a matching converter is
already in the set, the given converter replaces it. If the converter is
exactly the same as one already in the set, no changes are made.
The order in which converters are added is not relevent. The best
converter is selected by examining the object hierarchy.
Parameters: converter - the converter to add, null ignored replaced converter, or null |
getDurationConverters | public DurationConverter[] getDurationConverters()(Code) | | Gets a copy of the list of converters.
the converters, a copy of the real data, never null |
getInstantConverters | public InstantConverter[] getInstantConverters()(Code) | | Gets a copy of the set of converters.
the converters, a copy of the real data, never null |
getIntervalConverters | public IntervalConverter[] getIntervalConverters()(Code) | | Gets a copy of the list of converters.
the converters, a copy of the real data, never null |
getPartialConverters | public PartialConverter[] getPartialConverters()(Code) | | Gets a copy of the set of converters.
the converters, a copy of the real data, never null |
getPeriodConverters | public PeriodConverter[] getPeriodConverters()(Code) | | Gets a copy of the list of converters.
the converters, a copy of the real data, never null |
removeDurationConverter | public DurationConverter removeDurationConverter(DurationConverter converter) throws SecurityException(Code) | | Removes a converter from the set of converters. If the converter was
not in the set, no changes are made.
Parameters: converter - the converter to remove, null ignored replaced converter, or null |
removeInstantConverter | public InstantConverter removeInstantConverter(InstantConverter converter) throws SecurityException(Code) | | Removes a converter from the set of converters. If the converter was
not in the set, no changes are made.
Parameters: converter - the converter to remove, null ignored replaced converter, or null |
removeIntervalConverter | public IntervalConverter removeIntervalConverter(IntervalConverter converter) throws SecurityException(Code) | | Removes a converter from the set of converters. If the converter was
not in the set, no changes are made.
Parameters: converter - the converter to remove, null ignored replaced converter, or null |
removePartialConverter | public PartialConverter removePartialConverter(PartialConverter converter) throws SecurityException(Code) | | Removes a converter from the set of converters. If the converter was
not in the set, no changes are made.
Parameters: converter - the converter to remove, null ignored replaced converter, or null |
removePeriodConverter | public PeriodConverter removePeriodConverter(PeriodConverter converter) throws SecurityException(Code) | | Removes a converter from the set of converters. If the converter was
not in the set, no changes are made.
Parameters: converter - the converter to remove, null ignored replaced converter, or null |
toString | public String toString()(Code) | | Gets a debug representation of the object.
|
|
|