Package com.apgar.common.lib.constraint
Class GreaterOrEqualThanConstraint
java.lang.Object
com.apgar.common.lib.constraint.GreaterOrEqualThanConstraint
- All Implemented Interfaces:
Constraint<Object>,JavaBeanVersion
Greater or Equal Than Constraint used to compare two fields.
An error message, which can be customized, is displayed if the constraint is not verified.
It is defined in the XSD under the field and takes for argument the path of the second field to be compared to.
<xs:element name="sampleField" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation xml:lang="en-US">
<osd:label>Sample Field</osd:label>
</xs:documentation>
<xs:appinfo>
<osd:otherFacets>
<osd:constraint class="com.apgar.common.lib.constraint.GreaterOrEqualThanConstraint">
<path>../pathToCompareTo</path>
</osd:constraint>
</osd:otherFacets>
</xs:appinfo>
</xs:annotation>
</xs:element>
- Author:
- APGAR Consulting
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckOccurrence(Object value, ValueContextForValidation valueContext) Performs constraint checkgetPath()Gets the path of the compared fieldvoidSets the path of the compared fieldvoidsetup(ConstraintContext context) toUserDocumentation(Locale arg0, ValueContext arg1) Returns constraint messageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.orchestranetworks.schema.JavaBeanVersion
getBeanVersion
-
Constructor Details
-
GreaterOrEqualThanConstraint
public GreaterOrEqualThanConstraint()
-
-
Method Details
-
checkOccurrence
public void checkOccurrence(Object value, ValueContextForValidation valueContext) throws InvalidSchemaException Performs constraint check- Specified by:
checkOccurrencein interfaceConstraint<Object>- Throws:
InvalidSchemaException
-
setup
- Specified by:
setupin interfaceConstraint<Object>
-
toUserDocumentation
Returns constraint message- Specified by:
toUserDocumentationin interfaceConstraint<Object>- Throws:
InvalidSchemaException
-
getPath
Gets the path of the compared field- Returns:
- the path
-
setPath
Sets the path of the compared field- Parameters:
path- Path of the compared field
-