Package org.apache.tika.config
Class ConfigBase
- java.lang.Object
-
- org.apache.tika.config.ConfigBase
-
- Direct Known Subclasses:
AutoDetectParserConfig,EmitterManager,FetcherManager,MetadataFilter,MetadataListFilter,PipesConfigBase,PipesIterator,TikaServerClientConfig,TikaServerConfig
public abstract class ConfigBase extends Object
-
-
Constructor Summary
Constructors Constructor Description ConfigBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static <P,T>
PbuildComposite(String compositeElementName, Class<P> compositeClass, String itemName, Class<T> itemClass, InputStream is)Use this to build a list of components for a composite item (e.g.protected static <P,T>
PbuildComposite(String compositeElementName, Class<P> compositeClass, String itemName, Class<T> itemClass, Element properties)protected static <T> TbuildSingle(String itemName, Class<T> itemClass, InputStream is)Use this to build a single class, where the user specifies the instance class, e.g.protected static <T> TbuildSingle(String itemName, Class<T> itemClass, Element properties, T defaultValue)Use this to build a single class, where the user specifies the instance class, e.g.protected Set<String>configure(String nodeName, InputStream is)Use this to configure a subclass of ConfigBase, a single known object.protected voidhandleSettings(Set<String> settings)This should be overridden to do something with the settings after loading the object.
-
-
-
Method Detail
-
buildSingle
protected static <T> T buildSingle(String itemName, Class<T> itemClass, InputStream is) throws TikaConfigException, IOException
Use this to build a single class, where the user specifies the instance class, e.g. PipesIterator- Parameters:
itemName-is-- Throws:
TikaConfigExceptionIOException
-
buildSingle
protected static <T> T buildSingle(String itemName, Class<T> itemClass, Element properties, T defaultValue) throws TikaConfigException, IOException
Use this to build a single class, where the user specifies the instance class, e.g. PipesIterator- Parameters:
itemName-properties- -- the properties element in the config- Throws:
TikaConfigExceptionIOException
-
buildComposite
protected static <P,T> P buildComposite(String compositeElementName, Class<P> compositeClass, String itemName, Class<T> itemClass, InputStream is) throws TikaConfigException, IOException
Use this to build a list of components for a composite item (e.g. CompositeMetadataFilter, FetcherManager), each with their own configurations- Parameters:
compositeElementName-itemName-is-- Throws:
TikaConfigExceptionIOException
-
buildComposite
protected static <P,T> P buildComposite(String compositeElementName, Class<P> compositeClass, String itemName, Class<T> itemClass, Element properties) throws TikaConfigException, IOException
- Throws:
TikaConfigExceptionIOException
-
handleSettings
protected void handleSettings(Set<String> settings)
This should be overridden to do something with the settings after loading the object.- Parameters:
settings-
-
configure
protected Set<String> configure(String nodeName, InputStream is) throws TikaConfigException, IOException
Use this to configure a subclass of ConfigBase, a single known object.- Parameters:
nodeName-is-- Returns:
- Throws:
TikaConfigExceptionIOException
-
-