public interface ConstraintEnumeration<T> extends Constraint<T>
xs:enumeration
facet.
The constraint must be declared under the element
xs:annotation/xs:appinfo/osd:otherFacets
:
where<osd:constraintEnumeration class="com.foo.MyConstraintEnumeration" />
com.foo.MyConstraintEnumeration
is
the fully qualified name of the class implementing this interface.
It is also possible to set additional JavaBean properties:
where<osd:constraintEnumeration class="com.foo.MyConstraintEnumeration"> <param1>...</param1> <param2>...</param2> </osd:constraintEnumeration>
param1
and param2
are JavaBean properties of the class specified.
For more information, see the JavaBean specification.
See Constraint
life cycle.
ConstraintOnNull
Modifier and Type | Method and Description |
---|---|
String |
displayOccurrence(T aValue,
ValueContext aContext,
Locale aLocale)
Returns a string representation of the value specified for the end-user (a label).
|
List<T> |
getValues(ValueContext aContext)
Returns all values of the underlying enumeration
of this constraint.
|
checkOccurrence, setup, toUserDocumentation
List<T> getValues(ValueContext aContext) throws InvalidSchemaException
InvalidSchemaException
- if a dynamic condition in the data model prevents the execution of this method.String displayOccurrence(T aValue, ValueContext aContext, Locale aLocale) throws InvalidSchemaException
The specified value should be compatible with the type of the current node. Specifically,
it should be one of the values returned by getValues(ValueContext)
. However,
if this enumeration has changed, it is possible for the value to no longer be in the current
enumeration. Therefore, such cases must be handled properly by the implementation
of this method, independent of true validation errors.
aValue
- The value to displayaContext
- The current contextaLocale
- The current user localeInvalidSchemaException
- if a dynamic condition in the data model prevents the execution of this method.SchemaNode.displayOccurrence(Object, boolean, ValueContext, Locale)