Class GreaterOrEqualThanConstraint

java.lang.Object
com.apgar.common.lib.constraint.GreaterOrEqualThanConstraint
All Implemented Interfaces:
com.orchestranetworks.schema.Constraint<Object>, com.orchestranetworks.schema.JavaBeanVersion

public class GreaterOrEqualThanConstraint extends Object implements com.orchestranetworks.schema.Constraint<Object>
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 Details

    • GreaterOrEqualThanConstraint

      public GreaterOrEqualThanConstraint()
  • Method Details

    • checkOccurrence

      public void checkOccurrence(Object value, com.orchestranetworks.instance.ValueContextForValidation valueContext) throws com.orchestranetworks.schema.InvalidSchemaException
      Performs constraint check
      Specified by:
      checkOccurrence in interface com.orchestranetworks.schema.Constraint<Object>
      Throws:
      com.orchestranetworks.schema.InvalidSchemaException
    • setup

      public void setup(com.orchestranetworks.schema.ConstraintContext context)
      Specified by:
      setup in interface com.orchestranetworks.schema.Constraint<Object>
    • toUserDocumentation

      public String toUserDocumentation(Locale arg0, com.orchestranetworks.instance.ValueContext arg1) throws com.orchestranetworks.schema.InvalidSchemaException
      Returns constraint message
      Specified by:
      toUserDocumentation in interface com.orchestranetworks.schema.Constraint<Object>
      Throws:
      com.orchestranetworks.schema.InvalidSchemaException
    • getPath

      public String getPath()
      Gets the path of the compared field
      Returns:
      the path
    • setPath

      public void setPath(String path)
      Sets the path of the compared field
      Parameters:
      path - Path of the compared field