Package org.apache.tika.parser
Class ParseContext
- java.lang.Object
-
- org.apache.tika.parser.ParseContext
-
- All Implemented Interfaces:
Serializable
public class ParseContext extends Object implements Serializable
Parse context. Used to pass context information to Tika parsers.- Since:
- Apache Tika 0.5
- See Also:
- TIKA-275, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ParseContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)<T> Tget(Class<T> key)Returns the object in this context that implements the given interface.<T> Tget(Class<T> key, T defaultValue)Returns the object in this context that implements the given interface, or the given default value if such an object is not found.inthashCode()booleanisEmpty()Set<String>keySet()<T> voidset(Class<T> key, T value)Adds the given value to the context as an implementation of the given interface.
-
-
-
Method Detail
-
set
public <T> void set(Class<T> key, T value)
Adds the given value to the context as an implementation of the given interface.- Parameters:
key- the interface implemented by the given valuevalue- the value to be added, ornullto remove
-
get
public <T> T get(Class<T> key)
Returns the object in this context that implements the given interface.- Parameters:
key- the interface implemented by the requested object- Returns:
- the object that implements the given interface,
or
nullif not found
-
get
public <T> T get(Class<T> key, T defaultValue)
Returns the object in this context that implements the given interface, or the given default value if such an object is not found.- Parameters:
key- the interface implemented by the requested objectdefaultValue- value to return if the requested object is not found- Returns:
- the object that implements the given interface, or the given default value if not found
-
isEmpty
public boolean isEmpty()
-
-