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

# Class MetadataFilterChain

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

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

public class MetadataFilterChain extends AbstractMetadataFilter
A filter that allows the composition of `MetadataFilter`s. Filters will be executed on the given metadata document in the order they were added to the chain.

## Field Summary

Fields
Modifier and Type
Field
Description
`private List<MetadataFilter>`
`filters`
Registered filters.
`private org.slf4j.Logger`
`log`
Class logger.

## Constructor Summary

Constructors
Constructor
Description
`MetadataFilterChain()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`final XMLObject`
`filter(XMLObject xmlObject, MetadataFilterContext context)`
Filters the given metadata, perhaps to remove elements that are not wanted.
`List<MetadataFilter>`
`getFilters()`
Get the list of `MetadataFilter`s that make up this chain.
`void`
`setFilters(List<MetadataFilter> newFilters)`
Set the list of `MetadataFilter`s that make up this chain.

### 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

### log

@Nonnull private org.slf4j.Logger log
Class logger.

### filters

@Nonnull private List<MetadataFilter> filters
Registered filters.

## Constructor Details

### MetadataFilterChain

public MetadataFilterChain()
Constructor.

## Method Details

### filter

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

Parameters:
  `xmlObject` - 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

### getFilters

@Nonnull @Live public List<MetadataFilter> getFilters()
Get the list of `MetadataFilter`s that make up this chain.

Returns:
  the filters that make up this chain

### setFilters

public void setFilters(@Nonnull List<MetadataFilter> newFilters)
Set the list of `MetadataFilter`s that make up this chain.

Parameters:
  `newFilters` - list of `MetadataFilter`s that make up this chain