|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Specifies a constraint that may be contextual and dynamic. Regarding XML Schema, it may be considered as a programmatic extended facet.
The constraint must be declared under the element
xs:annotation/xs:appinfo/mdm:otherFacets
:
where<mdm:constraint class="com.foo.MyConstraint" />
com.foo.MyConstraint
is
the fully qualified name of the class implementing this interface.
It is also possible to set additional JavaBean properties:
where<mdm:constraint class="com.foo.MyConstraint"> <param1>...</param1> <param2>...</param2> </mdm:constraint>
param1
and param2
are JavaBean properties of the class specified.
For more information, read JavaBeans specification.
setParam1(...)
and
setParam2(...)
);setup(ConstraintContext)
is called on the new instance.checkOccurrence(Object, ValueContextForValidation)
is called each time an associated element or attribute has to be validated.
See checkOccurrence(Object, ValueContextForValidation)
.
ConstraintEnumeration
,
ConstraintNomenclature
,
ConstraintOnNull
Method Summary | |
void |
checkOccurrence(Object aValue,
ValueContextForValidation aValidationContext)
This method checks the value specified. |
void |
setup(ConstraintContext aContext)
This method is called when the schema is loaded, for checking and preparing this instance. |
String |
toUserDocumentation(Locale userLocale,
ValueContext aContext)
Returns a final user documentation about this constraint. |
Method Detail |
public void checkOccurrence(Object aValue, ValueContextForValidation aValidationContext) throws InvalidSchemaException
aValue
is not valid, it must add an
error message.
The value given as argument by the container is an occurrence. It means that if
the associated node is a multi-occurrenced element declaration (that is, maxOccurs > 1
),
this method is called for each occurrence of the element.
If the constraint is attached to a table with N occurrences, the full validation will call this method N times.
Hence for a table with large volumes of occurrences, it may be necessary to optimize the implementation (for example, by ensuring some caching in this instance).
For a single instance of this interface, this method may be called concurrently by several threads.
InvalidSchemaException
- if some schema's dynamic condition prevents the execution of this method.public void setup(ConstraintContext aContext)
This method must also declare the dependencies of the constraint, if any, so that validation is notified when a value is updated.
ConstraintContext.addDependency(Path)
public String toUserDocumentation(Locale userLocale, ValueContext aContext) throws InvalidSchemaException
For a single instance of this interface, this method may be called concurrently by several threads.
InvalidSchemaException
- if some schema's dynamic condition prevents the execution of this method.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.