org.opensaml.xml
Class AbstractValidatingSignableXMLObject

java.lang.Object
  extended by org.opensaml.xml.AbstractXMLObject
      extended by org.opensaml.xml.signature.AbstractSignableXMLObject
          extended by org.opensaml.xml.AbstractValidatingSignableXMLObject
All Implemented Interfaces:
SignableXMLObject, ValidatingXMLObject, XMLObject

public abstract class AbstractValidatingSignableXMLObject
extends AbstractSignableXMLObject
implements ValidatingXMLObject

Extension of AbstractSignableXMLObject that implements ValidatingXMLObject.


Constructor Summary
protected AbstractValidatingSignableXMLObject(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.signature.AbstractSignableXMLObject
getSignature, isSigned, setSignature
 
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

AbstractValidatingSignableXMLObject

protected AbstractValidatingSignableXMLObject(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 one of the child objects do not validate


Copyright © 2006-2011 Internet2. All Rights Reserved.