Package org.webharvest.definition
Class AbstractConfigSource
- java.lang.Object
-
- org.webharvest.definition.AbstractConfigSource
-
- All Implemented Interfaces:
ConfigSource
,HasReader
- Direct Known Subclasses:
BufferConfigSource
,FileConfigSource
,URLConfigSource
public abstract class AbstractConfigSource extends Object implements ConfigSource
Base class for other more specialized implementations ofConfigSource
interface. Provides implementation ofinclude(org.webharvest.definition.ConfigSource.Location)
method.- Since:
- 2.1.0-SNAPSHOT
- Version:
- %I%, %G%
- Author:
- Robert Bala
- See Also:
ConfigSource
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.webharvest.definition.ConfigSource
ConfigSource.Location
-
-
Field Summary
-
Fields inherited from interface org.webharvest.definition.ConfigSource
UNDEFINED_LOCATION
-
-
Constructor Summary
Constructors Constructor Description AbstractConfigSource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ConfigSource
include(ConfigSource.Location location)
Includes specifiedConfigSource.Location
from current configuration if possible.protected abstract void
visit(ConfigLocationVisitor visitor)
Depending on ownedConfigSource.Location
allows the ancestor class to accept interceptedConfigLocationVisitor
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.webharvest.definition.ConfigSource
getLocation
-
-
-
-
Method Detail
-
include
public final ConfigSource include(ConfigSource.Location location) throws IOException
Includes specifiedConfigSource.Location
from current configuration if possible. Included configuration is not merged but instead returned as a reference to newConfigSource
. Inclusion is smart enough to decide if the current configuration source points to a file system or remote web server location to determine the base for always contextual location that has been specified to include.- Specified by:
include
in interfaceConfigSource
- Parameters:
location
- reference toConfigSource.Location
to include.- Returns:
- Included instance of
ConfigSource
or throwsIllegalStateException
in case of unrecognizedConfigSource.Location
type. - Throws:
IOException
- In case of any problems with instantiation of includedConfigSource
-
visit
protected abstract void visit(ConfigLocationVisitor visitor) throws IOException
Depending on ownedConfigSource.Location
allows the ancestor class to accept interceptedConfigLocationVisitor
.- Parameters:
visitor
- reference toConfigLocationVisitor
- Throws:
IOException
- in case of any problem with inclusion ofConfigSource
.
-
-