E - The enumeration that should be used for values of this property
definition.public final class EnumPropertyDefinition<E extends Enum<E>> extends PropertyDefinition<E>
| Modifier and Type | Class and Description |
|---|---|
static class |
EnumPropertyDefinition.Builder<E extends Enum<E>>
An interface for incrementally constructing enumeration property
definitions.
|
PropertyDefinition.AbstractBuilder<T,D extends PropertyDefinition<T>>| Modifier and Type | Method and Description |
|---|---|
<R,P> R |
accept(PropertyDefinitionVisitor<R,P> v,
P p)
Apply a visitor to this property definition.
|
<R,P> R |
accept(PropertyValueVisitor<R,P> v,
E value,
P p)
Apply a visitor to a property value associated with this property
definition.
|
static <E extends Enum<E>> |
createBuilder(AbstractManagedObjectDefinition<?,?> d,
String propertyName)
Create an enumeration property definition builder.
|
E |
decodeValue(String value)
Parse and validate a string representation of a property value.
|
Class<E> |
getEnumClass()
Get the enumeration class used for values of this property.
|
LocalizableMessage |
getValueSynopsis(E value)
Gets the synopsis of the specified enumeration value of this enumeration
property definition in the default locale.
|
LocalizableMessage |
getValueSynopsis(Locale locale,
E value)
Gets the synopsis of the specified enumeration value of this enumeration
property definition in the specified locale.
|
String |
normalizeValue(E value)
Get a normalized string representation of a property value.
|
void |
validateValue(E value)
Determine if the provided property value is valid according to this
property definition.
|
castValue, compare, compareTo, encodeValue, equals, getAdministratorAction, getDefaultBehaviorProvider, getDescription, getDescription, getManagedObjectDefinition, getName, getSynopsis, getSynopsis, hashCode, hasOption, initialize, toString, toStringpublic static <E extends Enum<E>> EnumPropertyDefinition.Builder<E> createBuilder(AbstractManagedObjectDefinition<?,?> d, String propertyName)
E - The enumeration that should be used for values of this
property definition.d - The managed object definition associated with this property
definition.propertyName - The property name.public <R,P> R accept(PropertyDefinitionVisitor<R,P> v, P p)
accept in class PropertyDefinition<E extends Enum<E>>R - The return type of the visitor's methods.P - The type of the additional parameters to the visitor's
methods.v - The property definition visitor.p - Optional additional visitor parameter.public <R,P> R accept(PropertyValueVisitor<R,P> v, E value, P p)
accept in class PropertyDefinition<E extends Enum<E>>R - The return type of the visitor's methods.P - The type of the additional parameters to the visitor's
methods.v - The property value visitor.value - The property value.p - Optional additional visitor parameter.public E decodeValue(String value)
decodeValue in class PropertyDefinition<E extends Enum<E>>value - The property string value (must not be null).public Class<E> getEnumClass()
public final LocalizableMessage getValueSynopsis(E value)
value - The enumeration value.public final LocalizableMessage getValueSynopsis(Locale locale, E value)
value - The enumeration value.locale - The locale.public String normalizeValue(E value)
This method may throw an exception if the provided value is invalid.
However, applications should not assume that implementations of this
method will always validate a value. This task is the responsibility of
PropertyDefinition.validateValue(Object).
This default implementation simply returns the string representation of the provided value. Sub-classes might want to override this method if this behavior is insufficient (for example, a string property definition might strip white-space and convert characters to lower-case).
normalizeValue in class PropertyDefinition<E extends Enum<E>>value - The property value to be normalized.public void validateValue(E value)
validateValue in class PropertyDefinition<E extends Enum<E>>value - The property value (must not be null).Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.