Class AbstractDOMValidationStage<V,C extends DOMTraversalContext>

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
Type Parameters:
V - type of the values to be validated
C - the context to carry through 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:
AbstractElementVisitingValidationStage, ScopeValidationStage, X509ValidationStage

@ThreadSafe public abstract class AbstractDOMValidationStage<V,C extends DOMTraversalContext> extends AbstractDOMTraversalStage<C>
An abstract stage extending AbstractDOMTraversalStage to manage a collection of Validators to individual values.
Since:
0.9.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final ValidatorSequence<V>
    The validator sequence to apply.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    applyValidators(V obj, C context)
    Apply each of the configured validators in turn to the provided object.
    protected void
     
    protected void
     
    final List<Validator<V>>
    Gets the list of validators being applied to each item.
    void
    setValidators(List<Validator<V>> newValidators)
    Set the list of validators to apply to each item.

    Methods inherited from class net.shibboleth.metadata.dom.AbstractDOMTraversalStage

    addError, applicable, buildContext, doExecute, errorPrefix, visit

    Methods inherited from class net.shibboleth.metadata.pipeline.AbstractIteratingStage

    doExecute

    Methods inherited from class net.shibboleth.metadata.pipeline.AbstractStage

    execute, getCollectionPredicate, setCollectionPredicate

    Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

    setId

    Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

    ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException

    Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

    checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitialized

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

    destroy, isDestroyed

    Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

    getId

    Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

    initialize, isInitialized
  • Field Details

    • validators

      @Nonnull @NonnullElements @Unmodifiable private final ValidatorSequence<V> validators
      The validator sequence to apply.

      Thread safety: as a final field, access to validators does not need to be synchronised for thread safety. The referenced object is itself thread-safe.

  • Constructor Details

    • AbstractDOMValidationStage

      public AbstractDOMValidationStage()
  • Method Details

    • setValidators

      public void setValidators(@Nonnull @NonnullElements @Unmodifiable List<Validator<V>> newValidators)
      Set the list of validators to apply to each item.
      Parameters:
      newValidators - the list of validators to set
    • getValidators

      @Nonnull @NonnullElements @Unmodifiable public final List<Validator<V>> getValidators()
      Gets the list of validators being applied to each item.
      Returns:
      list of validators
    • applyValidators

      protected void applyValidators(@Nonnull V obj, @Nonnull C context) throws StageProcessingException
      Apply each of the configured validators in turn to the provided object.
      Parameters:
      obj - object to be validated
      context - context for the validation
      Throws:
      StageProcessingException - if errors occur during processing
    • doDestroy

      protected void doDestroy()
      Overrides:
      doDestroy in class net.shibboleth.shared.component.AbstractInitializableComponent
    • doInitialize

      protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException
      Overrides:
      doInitialize in class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
      Throws:
      net.shibboleth.shared.component.ComponentInitializationException