Package net.shibboleth.idp.attribute.transcoding.impl

# Class TranscodingRuleLoader

java.lang.Object
net.shibboleth.idp.attribute.transcoding.impl.TranscodingRuleLoader

public class TranscodingRuleLoader extends Object
A mechanism for loading a set of `TranscodingRule` objects from sources such as maps or directories of property files.

## Field Summary

Fields
Modifier and Type
Field
Description
`private org.slf4j.Logger`
`log`
Class logger.
`private final Collection<TranscodingRule>`
`rules`
Rules loaded.

## Constructor Summary

Constructors
Constructor
Description
`TranscodingRuleLoader(Path dir)`
Load rules from all files found below a directory root.
`TranscodingRuleLoader(Path dir, Collection<String> extensions)`
Load rules from all files found below a directory root.
`TranscodingRuleLoader(Collection<Map<String,Object>> maps)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Collection<TranscodingRule>`
`getRules()`
Get the rules loaded by this object.

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

### rules

@Nonnull private final Collection<TranscodingRule> rules
Rules loaded.

## Constructor Details

### TranscodingRuleLoader

public TranscodingRuleLoader(@Nonnull @ParameterName(name="dir") Path dir, @Nullable @ParameterName(name="extensions") Collection<String> extensions) throws IOException
Load rules from all files found below a directory root.

Files are assumed to be Java property files in text format.

Individual rules that fail to load will be skipped.

The file extensions must include the period, and only apply to files, while all directories will be examined.

Parameters:
  `dir` - root to search
  `extensions` - file extensions to include
Throws:
  `IOException` - if an error occurs

### TranscodingRuleLoader

public TranscodingRuleLoader(@Nonnull @ParameterName(name="dir") Path dir) throws IOException
Load rules from all files found below a directory root.

Files are assumed to be Java property files in text format.

Individual rules that fail to load will be skipped.

Parameters:
  `dir` - root to search
Throws:
  `IOException` - if an error occurs

### TranscodingRuleLoader

public TranscodingRuleLoader(@Nonnull @ParameterName(name="maps") Collection<Map<String,Object>> maps)
Constructor.

Parameters:
  `maps` - a collection of maps to build rules around directly.

## Method Details

### getRules

@Nonnull @Unmodifiable @NotLive public Collection<TranscodingRule> getRules()
Get the rules loaded by this object.

Returns:
  collection of rules