biz.c24.io.api.data
Class DomainConstraint

java.lang.Object
  extended by biz.c24.io.api.data.DefaultValidationRule
      extended by biz.c24.io.api.data.DomainConstraint
All Implemented Interfaces:
ModelComponent, ValidationRule, Validator, Serializable

public class DomainConstraint
extends DefaultValidationRule

A validation rule whose validation routine is dependent on an identifier looked up via an XPath statement in the object model being validated.

The XPath statment is given by the selector attribute and should be specified relative to the parent of the component to be validated

. The identifier found via the XPath statement is checked against DomainConstraintManager and the registered validator, if one exisits, is then responsible for answering the validation call.

Warning: Serialized objects of this class or of a deployed class which is derived from it may not be compatible with future releases of C24 Integreation Objects. The current serialization support is appropriate for short term storage or RMI between applications running the same version of C24 Integreation Objects.

See Also:
DomainConstraintManager, Serialized Form

Constructor Summary
DomainConstraint()
          Creates a new instance.
 
Method Summary
 String getIdentifier()
          Returns the identifier which will be used if no XPath selector is present or if the XPath selector's value is not found.
 XPathStatement getSelector()
          Returns the XPath selector which will be used to locate an identifier within the object model.
 void setIdentifier(String identifier)
          Sets the identifier which will be used if no XPath selector is present or if the XPath selector's value is not found.
 void setSelector(XPathStatement selector)
          Sets the XPath selector which will be used to locate an identifier within the object model.
 String toString()
           
 boolean validate(Object object, DataComponent component, ComplexDataObject context, ValidationManager manager)
          Validate the given object.
 
Methods inherited from class biz.c24.io.api.data.DefaultValidationRule
addDependentPredicateCode, getAnnotation, getContextForPredicateChecking, getDependentPredicateCode, getDependentPredicateCodeCount, getErrorCode, getName, getPredicateCode, getSeverity, removeDependentPredicateCode, setAnnotation, setErrorCode, setName, setPredicateCode, setSeverity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DomainConstraint

public DomainConstraint()
Creates a new instance.

Method Detail

getSelector

public XPathStatement getSelector()
Returns the XPath selector which will be used to locate an identifier within the object model.

Returns:
The selector.

setSelector

public void setSelector(XPathStatement selector)
Sets the XPath selector which will be used to locate an identifier within the object model.

Parameters:
selector - The selector.

getIdentifier

public String getIdentifier()
Returns the identifier which will be used if no XPath selector is present or if the XPath selector's value is not found.

Returns:
The identifier.

setIdentifier

public void setIdentifier(String identifier)
Sets the identifier which will be used if no XPath selector is present or if the XPath selector's value is not found.

Parameters:
identifier - The identifier.

validate

public boolean validate(Object object,
                        DataComponent component,
                        ComplexDataObject context,
                        ValidationManager manager)
                 throws ValidationException
Description copied from interface: Validator
Validate the given object.

Specified by:
validate in interface Validator
Overrides:
validate in class DefaultValidationRule
Parameters:
object - The object to be validated - commonly a String, Integer, Double, Date etc.
component - The Element or Attribute inside context which defines object.
context - The parent of object - could be null.
manager - The validation manager which is performing this validation.
Returns:
Whether the object is valid if the validation manager is not operating in exception mode.
Throws:
ValidationException - If the object is not valid and the validation maanger is operating in exception mode.

toString

public String toString()
Overrides:
toString in class DefaultValidationRule


C24 Technologies © 2002-2012: All Rights Reserved.