public interface ChronoExtension
Defines a configuration-dependent extension of the chronological
elements of a Chronology.
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(java.lang.Class<?> chronoType)
Will be called by a
java.util.ServiceLoader in order to determine
if the given chronological type should register this extension or not. |
java.util.Set<ChronoElement<?>> |
getElements(java.util.Locale locale,
AttributeQuery attributes)
Returns the element set for given configuration.
|
<T extends ChronoEntity<T>> |
resolve(T entity,
java.util.Locale locale,
AttributeQuery attributes)
Updates the given value source if necessary in order to resolve
the values of extension elements to values of standard elements.
|
boolean accept(java.lang.Class<?> chronoType)
Will be called by a java.util.ServiceLoader in order to determine
if the given chronological type should register this extension or not.
chronoType - chronological typetrue if given type should register this extension else falsejava.util.Set<ChronoElement<?>> getElements(java.util.Locale locale, AttributeQuery attributes)
Returns the element set for given configuration.
An empty Set indicates that this extension is not relevant
for the given configuration.
locale - language and country settingattributes - configuration attributes<T extends ChronoEntity<T>> T resolve(T entity, java.util.Locale locale, AttributeQuery attributes)
Updates the given value source if necessary in order to resolve the values of extension elements to values of standard elements.
Implementations are allowed to use null as pseudo-value
in order to delete an element from given source via the expression
entity.with(element, null). Note: The argument has
exceptionally no chronology.
T - generic type of applicable chronological entityentity - any kind of map from chronological elements to
their values (note that the main use case of parsed
data has no chronology and allows the virtual value
null to be set as indication for removing
associated element)locale - language and country settingattributes - configuration attributesjava.lang.IllegalArgumentException - if resolving fails due to inconsistenciesChronoEntity.with(ChronoElement, V)