Class InterpolatorSpecification
- java.lang.Object
-
- org.apache.commons.configuration2.interpol.InterpolatorSpecification
-
public final class InterpolatorSpecification extends java.lang.Object
A simple value class defining a
ConfigurationInterpolator
.Objects of this class can be used for creating new
ConfigurationInterpolator
instances; they contain all required properties. It is either possible to set a fully initializedConfigurationInterpolator
directly which can be used as is. Alternatively, some or all properties of an instance to be newly created can be set. These properties include- a map with
Lookup
objects associated with a specific prefix - a collection with default
Lookup
objects (without a prefix) - a parent
ConfigurationInterpolator
When setting up a configuration it is possible to define the
ConfigurationInterpolator
in terms of this class. The configuration will then either use theConfigurationInterpolator
instance explicitly defined in theInterpolatorSpecification
instance or create a new one.Instances are not created directly, but using the nested
Builder
class. They are then immutable.- Since:
- 2.0
- Version:
- $Id: InterpolatorSpecification.java 1790899 2017-04-10 21:56:46Z ggregory $
- a map with
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InterpolatorSpecification.Builder
A builder class for creating instances ofInterpolatorSpecification
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Lookup>
getDefaultLookups()
Returns a collection with the default lookups.ConfigurationInterpolator
getInterpolator()
Returns theConfigurationInterpolator
instance to be used directly.ConfigurationInterpolator
getParentInterpolator()
Returns the parentConfigurationInterpolator
object.java.util.Map<java.lang.String,Lookup>
getPrefixLookups()
Returns a map with prefix lookups.
-
-
-
Method Detail
-
getInterpolator
public ConfigurationInterpolator getInterpolator()
Returns theConfigurationInterpolator
instance to be used directly.- Returns:
- the
ConfigurationInterpolator
(can be null)
-
getParentInterpolator
public ConfigurationInterpolator getParentInterpolator()
Returns the parentConfigurationInterpolator
object.- Returns:
- the parent
ConfigurationInterpolator
(can be null)
-
getPrefixLookups
public java.util.Map<java.lang.String,Lookup> getPrefixLookups()
Returns a map with prefix lookups. The keys of the map are the prefix strings, its values are the correspondingLookup
objects.- Returns:
- the prefix lookups for a new
ConfigurationInterpolator
instance (never null)
-
getDefaultLookups
public java.util.Collection<Lookup> getDefaultLookups()
Returns a collection with the default lookups.- Returns:
- the default lookups for a new
ConfigurationInterpolator
instance (never null)
-
-