Package com.orchestranetworks.schema
Interface ConstraintEnumeration<T>
- All Superinterfaces:
Constraint<T>
,JavaBeanVersion
Specifies an enumeration constraint that can be contextual and dynamic.
This interface provides a programmatic extension of the
xs:enumeration
facet.
Definition in the data model
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.
Life cycle
See Constraint
life cycle.
-
Method Summary
Modifier and TypeMethodDescriptiondisplayOccurrence
(T aValue, ValueContext aContext, Locale aLocale) Returns a string representation of the value specified for the end-user (a label).getValues
(ValueContext aContext) Returns all values of the underlying enumeration of this constraint.Methods inherited from interface com.orchestranetworks.schema.Constraint
checkOccurrence, setup, toUserDocumentation
Methods inherited from interface com.orchestranetworks.schema.JavaBeanVersion
getBeanVersion
-
Method Details
-
getValues
Returns all values of the underlying enumeration of this constraint. All elements of the returned list must comply with the associated XML Schema type.- Throws:
InvalidSchemaException
- if a dynamic condition in the data model prevents the execution of this method.
-
displayOccurrence
String displayOccurrence(T aValue, ValueContext aContext, Locale aLocale) throws InvalidSchemaException Returns a string representation of the value specified for the end-user (a label).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.- Parameters:
aValue
- The value to displayaContext
- The current contextaLocale
- The current user locale- Throws:
InvalidSchemaException
- if a dynamic condition in the data model prevents the execution of this method.- See Also:
-