Package org.apache.tika.config
Class ConfigBase
java.lang.Object
org.apache.tika.config.ConfigBase
- Direct Known Subclasses:
AutoDetectParserConfig
,EmitterManager
,FetcherManager
,MetadataFilter
,PipesConfigBase
,PipesIterator
,TikaServerClientConfig
,TikaServerConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static <P,
T> P buildComposite
(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> P buildComposite
(String compositeElementName, Class<P> compositeClass, String itemName, Class<T> itemClass, Element properties) protected static <T> T
buildSingle
(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> T
buildSingle
(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.configure
(String nodeName, InputStream is) Use this to configure a subclass of ConfigBase, a single known object.protected void
handleSettings
(Set<String> settings) This should be overridden to do something with the settings after loading the object.
-
Constructor Details
-
ConfigBase
public ConfigBase()
-
-
Method Details
-
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:
TikaConfigException
IOException
-
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:
TikaConfigException
IOException
-
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:
TikaConfigException
IOException
-
buildComposite
protected static <P,T> P buildComposite(String compositeElementName, Class<P> compositeClass, String itemName, Class<T> itemClass, Element properties) throws TikaConfigException, IOException - Throws:
TikaConfigException
IOException
-
handleSettings
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:
TikaConfigException
IOException
-