Package net.shibboleth.metadata.dom
Class AbstractAttributeValidationStage<T>
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<T,Attr>
net.shibboleth.metadata.dom.AbstractAttributeValidationStage<T>
- Type Parameters:
T- type to convert each attribute to for validation
- 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:
StringAttributeValidationStage
public abstract class AbstractAttributeValidationStage<T>
extends AbstractElementVisitingValidationStage<T,Attr>
Abstract base class allowing a selected subset of XML attributes in a DOM document
to be validated as a given type.
- Since:
- 0.10.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionCollection of attribute names for those attributes we will be visiting. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanapplicable(Attr attr, DOMTraversalContext context) Returns whether the given attribute is applicable to our traversal.protected voidfinal Collection<QName>Gets the collection of attribute names to visit.final voidsetAttributeName(String name) Sets a single attribute name to be visited.final voidsetAttributeNames(Collection<String> names) Sets the collection of attribute names to visit, as a collection of unqualifiedStringvalues.final voidSets a single attribute name to be visited.final voidSets the collection of attribute names to visit.protected voidvisit(Element element, DOMTraversalContext context) Visit a particularElement.Methods inherited from class net.shibboleth.metadata.dom.AbstractElementVisitingValidationStage
applicable, buildContext, convert, getElementNames, setElementName, setElementNamesMethods inherited from class net.shibboleth.metadata.dom.AbstractDOMValidationStage
applyValidators, doDestroy, getValidators, setValidatorsMethods inherited from class net.shibboleth.metadata.dom.AbstractDOMTraversalStage
addError, doExecute, errorPrefixMethods 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
-
attributeNames
Collection of attribute names for those attributes we will be visiting.Internally, this is always held as a
SetofQNames, and that's how it will be returned by the getter. There are four setters, however, for both collections and singletons, and both simple attribute names and qualified names (@link QName}s).Because of type erasure, those setters can't all be overloads of the same method name, so the
String-based unqualified name forms (which will by far dominate use cases) are given the preferred identifiers.
-
-
Constructor Details
-
AbstractAttributeValidationStage
public AbstractAttributeValidationStage()
-
-
Method Details
-
getAttributeNames
Gets the collection of attribute names to visit.- Returns:
- collection of attribute names to visit
-
setAttributeNames
Sets the collection of attribute names to visit, as a collection of unqualifiedStringvalues.- Parameters:
names- collection of attribute names to visit
-
setAttributeName
Sets a single attribute name to be visited.Shorthand for use when a single unqualified attribute name, expressed as a
String, is used.- Parameters:
name- name for the attribute to be visited
-
setQualifiedAttributeNames
Sets the collection of attribute names to visit.- Parameters:
names- collection of qualified attribute names to visit
-
setQualifiedAttributeName
Sets a single attribute name to be visited.- Parameters:
name-QNamefor the attribute to be visited
-
visit
protected void visit(@Nonnull Element element, @Nonnull DOMTraversalContext context) throws StageProcessingException Description copied from class:AbstractDOMTraversalStageVisit a particularElement.- Specified by:
visitin classAbstractDOMTraversalStage<DOMTraversalContext>- Parameters:
element- theElementto visitcontext- the traversal context- Throws:
StageProcessingException- if errors occur during processing
-
applicable
Returns whether the given attribute is applicable to our traversal.- Parameters:
attr-Attrcandidate for visitingcontext-DOMTraversalContextimplementation being used to manage the traversal- Returns:
- returns whether the given attribute is applicable to our traversal
-
doInitialize
protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException- Overrides:
doInitializein classAbstractElementVisitingValidationStage<T,Attr> - Throws:
net.shibboleth.shared.component.ComponentInitializationException
-