biz.c24.io.api.data
Class DefaultValidationRule

java.lang.Object
  extended by biz.c24.io.api.data.DefaultValidationRule
All Implemented Interfaces:
ModelComponent, ValidationRule, Validator, Serializable
Direct Known Subclasses:
ContextualValidationRule, DatabaseLookupValidationRule, DomainConstraint, IdentifierOfCreditorValidator, IdentifierOfCreditorValidatorXT33, ISO13616IBANValidator, ISO3166CountryValidationRule, ISO4217CurrencyAmountAttributeValidator, ISO4217CurrencyAmountValidator, ISO9362BICValidationRule, LTAddressValidator, SwiftFieldValidationRule, SwiftPartyFieldJValidator, SwiftQualifierValidator, TARGET2Validator, ValueDateRule, XPathRule, XQueryRule, XsltValidator

public class DefaultValidationRule
extends Object
implements ValidationRule

The default validation rule implementation.

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:
Serialized Form

Constructor Summary
DefaultValidationRule()
          Creates a new instance.
 
Method Summary
 void addDependentPredicateCode(String code)
          Adds a dependent predicate code.
 Annotation getAnnotation()
          Returns the annotation associated with this rule.
protected  ComplexDataObject getContextForPredicateChecking(Object object, ComplexDataObject context)
           
 String getDependentPredicateCode(int index)
          Returns the dependent predicate code at index.
 int getDependentPredicateCodeCount()
          Returns the number of dependent predicate codes associated with this rule.
 String getErrorCode()
          Returns the error code associated with this rule.
 String getName()
          Returns the name of this component.
 String getPredicateCode()
          Returns the predicate code associated with this rule.
 ValidationSeverityEnum getSeverity()
          Returns the severity of this rule.
 void removeDependentPredicateCode(String code)
          Removes a dependent predicate code.
 void setAnnotation(Annotation annotation)
          Sets the annotation.
 void setErrorCode(String errorCode)
          Sets the error code.
 void setName(String name)
          Sets the name.
 void setPredicateCode(String predicateCode)
          Sets the predicate code.
 void setSeverity(ValidationSeverityEnum severity)
          Sets the severity.
 String toString()
           
 boolean validate(Object object, DataComponent component, ComplexDataObject context, ValidationManager manager)
          Validate the given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultValidationRule

public DefaultValidationRule()
Creates a new instance.

Method Detail

getName

public String getName()
Description copied from interface: ModelComponent
Returns the name of this component.

Specified by:
getName in interface ModelComponent
Returns:
The name.

getAnnotation

public Annotation getAnnotation()
Description copied from interface: ValidationRule
Returns the annotation associated with this rule.

Specified by:
getAnnotation in interface ValidationRule
Returns:
The annotation

getSeverity

public ValidationSeverityEnum getSeverity()
Description copied from interface: ValidationRule
Returns the severity of this rule.

Specified by:
getSeverity in interface ValidationRule
Returns:
The severity.

getErrorCode

public String getErrorCode()
Description copied from interface: ValidationRule
Returns the error code associated with this rule.

Specified by:
getErrorCode in interface ValidationRule
Returns:
The error code.

setName

public void setName(String name)
Sets the name.

Parameters:
name - The name.

setAnnotation

public void setAnnotation(Annotation annotation)
Sets the annotation.

Parameters:
annotation - The annotation.

setSeverity

public void setSeverity(ValidationSeverityEnum severity)
Sets the severity.

Parameters:
severity - The severity.

setErrorCode

public void setErrorCode(String errorCode)
Sets the error code.

Parameters:
errorCode - The error code.

getPredicateCode

public String getPredicateCode()
Description copied from interface: ValidationRule
Returns the predicate code associated with this rule.

Specified by:
getPredicateCode in interface ValidationRule
Returns:
The predicate code.

setPredicateCode

public void setPredicateCode(String predicateCode)
Sets the predicate code.

Parameters:
predicateCode - The predicate code.

getDependentPredicateCodeCount

public int getDependentPredicateCodeCount()
Description copied from interface: ValidationRule
Returns the number of dependent predicate codes associated with this rule.

Specified by:
getDependentPredicateCodeCount in interface ValidationRule
Returns:
The count.

getDependentPredicateCode

public String getDependentPredicateCode(int index)
Description copied from interface: ValidationRule
Returns the dependent predicate code at index.

Specified by:
getDependentPredicateCode in interface ValidationRule
Parameters:
index - the index of the code to return.
Returns:
The code.

addDependentPredicateCode

public void addDependentPredicateCode(String code)
Adds a dependent predicate code.

Parameters:
code - The code to add.

removeDependentPredicateCode

public void removeDependentPredicateCode(String code)
Removes a dependent predicate code.

Parameters:
code - The code to remove.

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
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 Object

getContextForPredicateChecking

protected ComplexDataObject getContextForPredicateChecking(Object object,
                                                           ComplexDataObject context)


C24 Technologies © 2002-2012: All Rights Reserved.