Package org.apache.tika.sax
Class BasicContentHandlerFactory
- java.lang.Object
- 
- org.apache.tika.sax.BasicContentHandlerFactory
 
- 
- All Implemented Interfaces:
- Serializable,- ContentHandlerFactory,- WriteLimiter
 
 public class BasicContentHandlerFactory extends Object implements ContentHandlerFactory, WriteLimiter Basic factory for creating common types of ContentHandlers- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classBasicContentHandlerFactory.HANDLER_TYPECommon handler types for content.
 - 
Constructor SummaryConstructors Constructor Description BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type, int writeLimit)Create a BasicContentHandlerFactory withthrowOnWriteLimitReachedis trueBasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type, int writeLimit, boolean throwOnWriteLimitReached, ParseContext parseContext)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentHandlergetNewContentHandler()ContentHandlergetNewContentHandler(OutputStream os, Charset charset)BasicContentHandlerFactory.HANDLER_TYPEgetType()intgetWriteLimit()booleanisThrowOnWriteLimitReached()static BasicContentHandlerFactory.HANDLER_TYPEparseHandlerType(String handlerTypeName, BasicContentHandlerFactory.HANDLER_TYPE defaultType)Tries to parse string into handler type.
 
- 
- 
- 
Constructor Detail- 
BasicContentHandlerFactorypublic BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type, int writeLimit) Create a BasicContentHandlerFactory withthrowOnWriteLimitReachedis true- Parameters:
- type- basic type of handler
- writeLimit- max number of characters to store; if < 0, the handler will store all characters
 
 - 
BasicContentHandlerFactorypublic BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type, int writeLimit, boolean throwOnWriteLimitReached, ParseContext parseContext) - Parameters:
- type- basic type of handler
- writeLimit- maximum number of characters to store
- throwOnWriteLimitReached- whether or not to throw a- WriteLimitReachedExceptionwhen the write limit has been reached
- parseContext- to store the writelimitreached warning if throwOnWriteLimitReached is set to- false
 
 
- 
 - 
Method Detail- 
parseHandlerTypepublic static BasicContentHandlerFactory.HANDLER_TYPE parseHandlerType(String handlerTypeName, BasicContentHandlerFactory.HANDLER_TYPE defaultType) Tries to parse string into handler type. Returns default if string is null or parse fails. Options: xml, html, text, body, ignore (no content)- Parameters:
- handlerTypeName- string to parse
- defaultType- type to return if parse fails
- Returns:
- handler type
 
 - 
getNewContentHandlerpublic ContentHandler getNewContentHandler() - Specified by:
- getNewContentHandlerin interface- ContentHandlerFactory
 
 - 
getNewContentHandlerpublic ContentHandler getNewContentHandler(OutputStream os, Charset charset) - Specified by:
- getNewContentHandlerin interface- ContentHandlerFactory
 
 - 
getTypepublic BasicContentHandlerFactory.HANDLER_TYPE getType() - Returns:
- handler type used by this factory
 
 - 
getWriteLimitpublic int getWriteLimit() - Specified by:
- getWriteLimitin interface- WriteLimiter
 
 - 
isThrowOnWriteLimitReachedpublic boolean isThrowOnWriteLimitReached() - Specified by:
- isThrowOnWriteLimitReachedin interface- WriteLimiter
 
 
- 
 
-