org.opensaml.xml.validation
Class ValidatorSuite

java.lang.Object
  extended by org.opensaml.xml.validation.ValidatorSuite

public class ValidatorSuite
extends java.lang.Object

A collection of validators that can be applied to an XMLObject and its children. These collections can represent usage specific checks, such as those outlined in things like profiles for specific XML specification. Registered Validators must be stateless. The xmlObjectTarget may be the XMLObject's element QName retrieved by XMLObject.getElementQName() or schema type, retrieved by XMLObject.getSchemaType(), with schema type registered checks performed first.


Constructor Summary
ValidatorSuite(java.lang.String suiteId)
          Constructor.
 
Method Summary
 void deregisterValidator(javax.xml.namespace.QName xmlObjectTarget, Validator validator)
          Removes a validator from this suite.
 java.lang.String getId()
          Gets a unique ID for this suite.
 java.util.List<Validator> getValidators(javax.xml.namespace.QName xmlObjectTarget)
          Gets an immutable list of validators for a given XMLObject target.
 void registerValidator(javax.xml.namespace.QName xmlObjectTarget, Validator validator)
          Registers a new validator in the suite.
 void validate(XMLObject xmlObject)
          Evaluates the registered validators against the given XMLObject and it's children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatorSuite

public ValidatorSuite(java.lang.String suiteId)
Constructor.

Parameters:
suiteId - unique ID for this suite
Method Detail

getId

public java.lang.String getId()
Gets a unique ID for this suite.

Returns:
a unique ID for this suite

validate

public void validate(XMLObject xmlObject)
              throws ValidationException
Evaluates the registered validators against the given XMLObject and it's children.

Parameters:
xmlObject - the XMLObject to validate
Throws:
ValidationException - thrown if the element is not valid

getValidators

public java.util.List<Validator> getValidators(javax.xml.namespace.QName xmlObjectTarget)
Gets an immutable list of validators for a given XMLObject target.

Parameters:
xmlObjectTarget - the XMLObject the returned list of validators operates on
Returns:
the list of validators for the XMLObject

registerValidator

public void registerValidator(javax.xml.namespace.QName xmlObjectTarget,
                              Validator validator)
Registers a new validator in the suite.

Parameters:
validator - the validator
xmlObjectTarget - the XMLObject the validator should operate on

deregisterValidator

public void deregisterValidator(javax.xml.namespace.QName xmlObjectTarget,
                                Validator validator)
Removes a validator from this suite.

Parameters:
xmlObjectTarget - the XMLObject the validator is currently registered for
validator - the validator to remove


Copyright © 2006-2011 Internet2. All Rights Reserved.