Package org.apache.tika.sax
Class BasicContentHandlerFactory
- java.lang.Object
-
- org.apache.tika.sax.BasicContentHandlerFactory
-
- All Implemented Interfaces:
java.io.Serializable
,ContentHandlerFactory
public class BasicContentHandlerFactory extends java.lang.Object implements ContentHandlerFactory
Basic factory for creating common types of ContentHandlers- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BasicContentHandlerFactory.HANDLER_TYPE
Common handler types for content.
-
Constructor Summary
Constructors Constructor Description BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type, int writeLimit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.xml.sax.ContentHandler
getNewContentHandler()
org.xml.sax.ContentHandler
getNewContentHandler(java.io.OutputStream os, java.lang.String encoding)
org.xml.sax.ContentHandler
getNewContentHandler(java.io.OutputStream os, java.nio.charset.Charset charset)
BasicContentHandlerFactory.HANDLER_TYPE
getType()
static BasicContentHandlerFactory.HANDLER_TYPE
parseHandlerType(java.lang.String handlerTypeName, BasicContentHandlerFactory.HANDLER_TYPE defaultType)
Tries to parse string into handler type.
-
-
-
Constructor Detail
-
BasicContentHandlerFactory
public BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type, int writeLimit)
- Parameters:
type
- basic type of handlerwriteLimit
- max number of characters to store; if < 0, the handler will store all characters
-
-
Method Detail
-
parseHandlerType
public static BasicContentHandlerFactory.HANDLER_TYPE parseHandlerType(java.lang.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 parsedefaultType
- type to return if parse fails- Returns:
- handler type
-
getNewContentHandler
public org.xml.sax.ContentHandler getNewContentHandler()
- Specified by:
getNewContentHandler
in interfaceContentHandlerFactory
-
getNewContentHandler
public org.xml.sax.ContentHandler getNewContentHandler(java.io.OutputStream os, java.lang.String encoding) throws java.io.UnsupportedEncodingException
- Specified by:
getNewContentHandler
in interfaceContentHandlerFactory
- Throws:
java.io.UnsupportedEncodingException
-
getNewContentHandler
public org.xml.sax.ContentHandler getNewContentHandler(java.io.OutputStream os, java.nio.charset.Charset charset)
- Specified by:
getNewContentHandler
in interfaceContentHandlerFactory
-
getType
public BasicContentHandlerFactory.HANDLER_TYPE getType()
- Returns:
- handler type used by this factory
-
-