Package com.apgar.common.lib.constraint
Class GreaterThanConstraint
java.lang.Object
com.apgar.common.lib.constraint.BundledConstraint
com.apgar.common.lib.constraint.GreaterThanConstraint
- All Implemented Interfaces:
com.orchestranetworks.schema.Constraint<Object>,com.orchestranetworks.schema.JavaBeanVersion
public class GreaterThanConstraint
extends BundledConstraint
implements com.orchestranetworks.schema.Constraint<Object>
Greater Than Constraint used to compare two fields.
The error message and/or information message created in the error.properties and text.properties files respectively will be displayed if the constraint is not verified.
- error.properties to be set: constraint.com.apgar.common.lib.constraint.GreaterThanConstraint {0} must be greater than {1}
- text.properties to be set: constraint.com.apgar.common.lib.constraint.GreaterThanConstraint {0} must be greater than {1}
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.GreaterThanConstraint">
<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, com.orchestranetworks.instance.ValueContextForValidation valueContext) Performs constraint checkGets the blockCommit variable specifying whether the constraint blocks an operationgetPath()Gets the path of the compared fieldvoidsetBlockCommit(String blockCommit) Sets the blockCommit variable specifying whether the constraint blocks an operationvoidSets the path of the compared fieldvoidsetup(com.orchestranetworks.schema.ConstraintContext context) toUserDocumentation(Locale locale, com.orchestranetworks.instance.ValueContext valueContext) Returns constraint messageMethods inherited from class com.apgar.common.lib.constraint.BundledConstraint
createErrorUserMessage, createErrorUserMessage, createErrorUserMessage, createErrorUserMessage, createUserDocumentation, createUserDocumentation, createUserDocumentation, createUserDocumentation, getDocumentationBundleBaseName, getErrorBundleBaseName, getPropertiesBaseKeyMethods 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
-
GreaterThanConstraint
public GreaterThanConstraint()
-
-
Method Details
-
checkOccurrence
public void checkOccurrence(Object value, com.orchestranetworks.instance.ValueContextForValidation valueContext) throws com.orchestranetworks.schema.InvalidSchemaException Performs constraint check- Specified by:
checkOccurrencein interfacecom.orchestranetworks.schema.Constraint<Object>- Throws:
com.orchestranetworks.schema.InvalidSchemaException
-
setup
public void setup(com.orchestranetworks.schema.ConstraintContext context) - Specified by:
setupin interfacecom.orchestranetworks.schema.Constraint<Object>
-
toUserDocumentation
public String toUserDocumentation(Locale locale, com.orchestranetworks.instance.ValueContext valueContext) throws com.orchestranetworks.schema.InvalidSchemaException Returns constraint message- Specified by:
toUserDocumentationin interfacecom.orchestranetworks.schema.Constraint<Object>- Throws:
com.orchestranetworks.schema.InvalidSchemaException
-
getPath
Gets the path of the compared field- Returns:
- String path of the compared field
-
setPath
Sets the path of the compared field- Parameters:
path- Path of the compared field
-
getBlockCommit
Gets the blockCommit variable specifying whether the constraint blocks an operation- Returns:
- String blockCommit variable
-
setBlockCommit
Sets the blockCommit variable specifying whether the constraint blocks an operation- Parameters:
blockCommit- variable specifying whether the constraint blocks an operation
-