Package org.opensaml.saml.metadata.resolver.filter.impl

# Class NodeProcessingMetadataFilter

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.saml.metadata.resolver.filter.AbstractMetadataFilter
org.opensaml.saml.metadata.resolver.filter.impl.NodeProcessingMetadataFilter

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `MetadataFilter`

public class NodeProcessingMetadataFilter extends AbstractMetadataFilter
An implementation of `MetadataFilter` which applies a `MetadataNodeProcessor` to each element node in the metadata document tree. The node processors will be applied in the order of `List` provided by `setNodeProcessors(List)`. The metadata document tree is traversed depth-first.

## Field Summary

Fields
Modifier and Type
Field
Description
`private List<MetadataNodeProcessor>`
`processors`
The ordered list of metadata node processors.

## Constructor Summary

Constructors
Constructor
Description
`NodeProcessingMetadataFilter()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`XMLObject`
`filter(XMLObject metadata, MetadataFilterContext context)`
Filters the given metadata, perhaps to remove elements that are not wanted.
`List<MetadataNodeProcessor>`
`getNodeProcessors()`
Get the list of metadata node processors.
`protected void`
`processNode(XMLObject node)`
Process an individual metadata node.
`void`
`setNodeProcessors(List<MetadataNodeProcessor> newProcessors)`
Set the list of metadata node processors.

### Methods inherited from class org.opensaml.saml.metadata.resolver.filter.AbstractMetadataFilter

`getType, setType`

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

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

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

## Field Details

### processors

@Nonnull private List<MetadataNodeProcessor> processors
The ordered list of metadata node processors.

## Constructor Details

### NodeProcessingMetadataFilter

public NodeProcessingMetadataFilter()
Constructor.

## Method Details

### getNodeProcessors

@Nonnull @Live public List<MetadataNodeProcessor> getNodeProcessors()
Get the list of metadata node processors.

Returns:
  the list of metadata node processors

### setNodeProcessors

public void setNodeProcessors(@Nonnull List<MetadataNodeProcessor> newProcessors)
Set the list of metadata node processors.

Parameters:
  `newProcessors` - the new list of processors to set.

### filter

@Nullable public XMLObject filter(@Nullable XMLObject metadata, @Nonnull MetadataFilterContext context) throws FilterException
Filters the given metadata, perhaps to remove elements that are not wanted.

Parameters:
  `metadata` - the metadata to be filtered.
  `context` - the metadata filter context
Returns:
  the filtered XMLObject, which may or may not be the same as the XMLObject instance passed in to the method. Maybe be null, for example if the top-level element was removed by the filter.
Throws:
  `FilterException` - thrown if an error occurs during the filtering process

### processNode

protected void processNode(@Nonnull XMLObject node) throws FilterException
Process an individual metadata node.

Parameters:
  `node` - the metadata node to process.
Throws:
  `FilterException` - if a fatal error is encountered while processing a node