biz.c24.io.api.data
Interface Validator

All Superinterfaces:
Serializable
All Known Subinterfaces:
Enumeration, ValidationRule
All Known Implementing Classes:
ContextualValidationRule, DatabaseLookupValidationRule, DatabaseSourcedEnumeration, DefaultEnumeration, DefaultValidationRule, DomainConstraint, IdentifierOfCreditorValidator, IdentifierOfCreditorValidatorXT33, ISO13616IBANValidator, ISO3166CountryValidationRule, ISO3166CountryValidator, ISO4217CurrencyAmountAttributeValidator, ISO4217CurrencyAmountValidator, ISO4217CurrencyAttributeValidator, ISO4217CurrencyValidator, ISO9362BICValidationRule, ISO9362BICValidator, LTAddressValidator, MappedEnumeration, SimpleValidator, SourcedEnumeration, Swdml31Validator, SwdmlEqd42Validator, SwdmlGenericValidator, SwdmlIrd42Validator, SwdmlValidator, SwiftCurrency_PCT_REN_YLD_Validator, SwiftFieldValidationRule, SwiftPartyFieldJValidator, SwiftQualifierValidator, TARGET2Validator, URISourcedEnumeration, ValueDateRule, XPathRule, XQueryRule, XsltValidator

public interface Validator
extends Serializable

An object capable of validating an item of data.

Implementations of this interface should never throw ValidationExceptions directly because the object being validated may have be using the validation event mechansim. Instead they should call ValidationManager.fireValidationEvent(ValidationEvent) which will in turn fire an event or throw an exception as required.

Also, care should be taken to always return false when a validation event has occurred and always return true if not, otherwise validation will fail with no error reported or vice-versa.


Method Summary
 boolean validate(Object object, DataComponent component, ComplexDataObject context, ValidationManager manager)
          Validate the given object.
 

Method Detail

validate

boolean validate(Object object,
                 DataComponent component,
                 ComplexDataObject context,
                 ValidationManager manager)
                 throws ValidationException
Validate the given object.

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.


C24 Technologies © 2002-2012: All Rights Reserved.