Package net.shibboleth.metadata.dom
Class AbstractElementVisitingValidationStage<V,N>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.metadata.pipeline.AbstractStage<T>
net.shibboleth.metadata.pipeline.AbstractIteratingStage<Element>
net.shibboleth.metadata.dom.AbstractDOMTraversalStage<C>
net.shibboleth.metadata.dom.AbstractDOMValidationStage<V,DOMTraversalContext>
net.shibboleth.metadata.dom.AbstractElementVisitingValidationStage<V,N>
- Type Parameters:
V- type of the values to be validatedN- type of node being visited during the traversal
- All Implemented Interfaces:
Stage<Element>,net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.IdentifiableComponent,net.shibboleth.shared.component.IdentifiedComponent,net.shibboleth.shared.component.InitializableComponent
- Direct Known Subclasses:
AbstractAttributeValidationStage,AbstractElementValidationStage
public abstract class AbstractElementVisitingValidationStage<V,N>
extends AbstractDOMValidationStage<V,DOMTraversalContext>
Abstract parent class for validation of DOM nodes within a DOM traversal.
Note that the nodes being validated may be either elements or attributes; this class is parameterised by that type and a subclass must implement an appropriate conversion.
This class manages the set of Element names for the traversal.
-
Field Summary
FieldsModifier and TypeFieldDescriptionCollection of element names for those elements we will be visiting. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanapplicable(Element e, DOMTraversalContext context) Indicates whether the visitor should be applied to a particularElement.protected DOMTraversalContextbuildContext(Item<Element> item) Build the context for a particular traversal.protected abstract VConvert the visitedNodeto the type to be validated.protected voidfinal Collection<QName>Gets the collection of element names to visit.final voidsetElementName(QName name) Sets a single element name to be visited.final voidsetElementNames(Collection<QName> names) Sets the collection of element names to visit.Methods inherited from class net.shibboleth.metadata.dom.AbstractDOMValidationStage
applyValidators, doDestroy, getValidators, setValidatorsMethods inherited from class net.shibboleth.metadata.dom.AbstractDOMTraversalStage
addError, doExecute, errorPrefix, visitMethods inherited from class net.shibboleth.metadata.pipeline.AbstractIteratingStage
doExecuteMethods inherited from class net.shibboleth.metadata.pipeline.AbstractStage
execute, getCollectionPredicate, setCollectionPredicateMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
elementNames
Collection of element names for those elements we will be visiting.
-
-
Constructor Details
-
AbstractElementVisitingValidationStage
public AbstractElementVisitingValidationStage()
-
-
Method Details
-
getElementNames
Gets the collection of element names to visit.- Returns:
- collection of element names to visit.
-
setElementNames
Sets the collection of element names to visit.- Parameters:
names- collection of element names to visit.
-
setElementName
Sets a single element name to be visited.Shorthand for
setElementNames(java.util.Collection<javax.xml.namespace.QName>)with a singleton set.- Parameters:
name-QNamefor the element to be visited.
-
buildContext
Description copied from class:AbstractDOMTraversalStageBuild the context for a particular traversal.- Specified by:
buildContextin classAbstractDOMTraversalStage<DOMTraversalContext>- Parameters:
item- theItemwe are traversing- Returns:
- an appropriate context
-
applicable
Description copied from class:AbstractDOMTraversalStageIndicates whether the visitor should be applied to a particularElement.- Specified by:
applicablein classAbstractDOMTraversalStage<DOMTraversalContext>- Parameters:
e-Elementto which we may wish to apply the visitorcontext-DOMTraversalContextimplementation being used to manage the traversal- Returns:
trueif the visitor should be applied to thisElement.
-
convert
Convert the visitedNodeto the type to be validated.- Parameters:
node- node being validated- Returns:
- converted value
-
doInitialize
protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException- Overrides:
doInitializein classAbstractDOMValidationStage<V,DOMTraversalContext> - Throws:
net.shibboleth.shared.component.ComponentInitializationException
-