org.opensaml.xml.validation
Class AbstractValidatingXMLObject

java.lang.Object
  extended by org.opensaml.xml.AbstractXMLObject
      extended by org.opensaml.xml.validation.AbstractValidatingXMLObject
All Implemented Interfaces:
ValidatingXMLObject, XMLObject
Direct Known Subclasses:
AbstractElementExtensibleXMLObject, AgreementMethodImpl, CipherDataImpl, CipherReferenceImpl, DHKeyValueImpl, DigestMethodImpl, DSAKeyValueImpl, EncryptedTypeImpl, EncryptionMethodImpl, EncryptionPropertiesImpl, EncryptionPropertyImpl, KeyInfoTypeImpl, KeyValueImpl, PGPDataImpl, ReferenceListImpl, ReferenceTypeImpl, RetrievalMethodImpl, RSAKeyValueImpl, SPKIDataImpl, TransformImpl, TransformsImpl, TransformsImpl, X509CertificateImpl, X509CRLImpl, X509DataImpl, X509IssuerSerialImpl, X509SerialNumberImpl, XSAnyImpl, XSBase64BinaryImpl, XSDateTimeImpl, XSIntegerImpl, XSQNameImpl, XSStringImpl, XSURIImpl

public abstract class AbstractValidatingXMLObject
extends AbstractXMLObject
implements ValidatingXMLObject

Extension of AbstractXMLObject that implements ValidatingXMLObject.


Constructor Summary
protected AbstractValidatingXMLObject(String namespaceURI, String elementLocalName, String namespacePrefix)
          Constructor.
 
Method Summary
 void deregisterValidator(Validator validator)
          Deregisters a validator for this XMLObject.
 List<Validator> getValidators()
          Gets the list of validators for this XMLObject or null if there is no list.
 void registerValidator(Validator validator)
          Registers a validator for this XMLObject.
 void validate(boolean validateDescendants)
          Validates this XMLObject against all registered validators.
protected  void validateChildren(XMLObject xmlObject)
          Recursive method used to validate all the children of the given XMLObject that implement ValidatingXMLObject.
 
Methods inherited from class org.opensaml.xml.AbstractXMLObject
addNamespace, detach, getDOM, getElementQName, getIDIndex, getNamespaceManager, getNamespaces, getNoNamespaceSchemaLocation, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, isNil, isNilXSBoolean, manageQualifiedAttributeNamespace, prepareAttributeValueForAssignment, prepareElementContentForAssignment, prepareForAssignment, prepareForAssignment, prepareForAssignment, prepareForAssignment, registerOwnID, releaseChildrenDOM, releaseDOM, releaseParentDOM, releaseThisAndChildrenDOM, releaseThisandParentDOM, removeNamespace, resolveID, resolveIDFromRoot, setDOM, setElementNamespacePrefix, setElementQName, setNil, setNil, setNoNamespaceSchemaLocation, setParent, setSchemaLocation, setSchemaType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.xml.XMLObject
addNamespace, detach, getDOM, getElementQName, getIDIndex, getNamespaceManager, getNamespaces, getNoNamespaceSchemaLocation, getOrderedChildren, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, isNil, isNilXSBoolean, releaseChildrenDOM, releaseDOM, releaseParentDOM, removeNamespace, resolveID, resolveIDFromRoot, setDOM, setNil, setNil, setNoNamespaceSchemaLocation, setParent, setSchemaLocation
 

Constructor Detail

AbstractValidatingXMLObject

protected AbstractValidatingXMLObject(String namespaceURI,
                                      String elementLocalName,
                                      String namespacePrefix)
Constructor.

Parameters:
namespaceURI - the namespace the element is in
elementLocalName - the local name of the XML element this Object represents
namespacePrefix - the prefix for the given namespace
Method Detail

getValidators

public List<Validator> getValidators()
Gets the list of validators for this XMLObject or null if there is no list.

Specified by:
getValidators in interface ValidatingXMLObject
Returns:
the list of validators for this XMLObject

registerValidator

public void registerValidator(Validator validator)
Registers a validator for this XMLObject.

Specified by:
registerValidator in interface ValidatingXMLObject
Parameters:
validator - the validator

deregisterValidator

public void deregisterValidator(Validator validator)
Deregisters a validator for this XMLObject.

Specified by:
deregisterValidator in interface ValidatingXMLObject
Parameters:
validator - the validator

validate

public void validate(boolean validateDescendants)
              throws ValidationException
Validates this XMLObject against all registered validators.

Specified by:
validate in interface ValidatingXMLObject
Parameters:
validateDescendants - true if all the descendants of this object should be validated as well, false if not
Throws:
ValidationException - thrown if the element is not valid

validateChildren

protected void validateChildren(XMLObject xmlObject)
                         throws ValidationException
Recursive method used to validate all the children of the given XMLObject that implement ValidatingXMLObject. Note, this can be a very expensive operation.

Parameters:
xmlObject - xmlObject whose descendants should be validated
Throws:
ValidationException - thrown if any child objects are not valid


Copyright © 2006-2011 Internet2. All Rights Reserved.