public class BasicContentHandlerFactory extends Object implements ContentHandlerFactory, WriteLimiter
| Modifier and Type | Class and Description |
|---|---|
static class |
BasicContentHandlerFactory.HANDLER_TYPE
Common handler types for content.
|
| Constructor and Description |
|---|
BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type,
int writeLimit) |
BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type,
int writeLimit,
boolean throwOnWriteLimitReached,
ParseContext parseContext) |
| Modifier and Type | Method and Description |
|---|---|
ContentHandler |
getNewContentHandler() |
ContentHandler |
getNewContentHandler(OutputStream os,
Charset charset) |
ContentHandler |
getNewContentHandler(OutputStream os,
String encoding) |
BasicContentHandlerFactory.HANDLER_TYPE |
getType() |
int |
getWriteLimit() |
boolean |
isThrowOnWriteLimitReached() |
static BasicContentHandlerFactory.HANDLER_TYPE |
parseHandlerType(String handlerTypeName,
BasicContentHandlerFactory.HANDLER_TYPE defaultType)
Tries to parse string into handler type.
|
public BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type, int writeLimit)
type - basic type of handlerwriteLimit - max number of characters to store; if < 0,
the handler will store all characterspublic BasicContentHandlerFactory(BasicContentHandlerFactory.HANDLER_TYPE type, int writeLimit, boolean throwOnWriteLimitReached, ParseContext parseContext)
type - basic type of handlerwriteLimit - maximum number of characters to storethrowOnWriteLimitReached - whether or not to throw a
WriteLimitReachedException
when the write limit has been reachedparseContext - to store the writelimitreached warning if
throwOnWriteLimitReached is set to falsepublic static BasicContentHandlerFactory.HANDLER_TYPE parseHandlerType(String handlerTypeName, BasicContentHandlerFactory.HANDLER_TYPE defaultType)
handlerTypeName - string to parsedefaultType - type to return if parse failspublic ContentHandler getNewContentHandler()
getNewContentHandler in interface ContentHandlerFactorypublic ContentHandler getNewContentHandler(OutputStream os, String encoding) throws UnsupportedEncodingException
getNewContentHandler in interface ContentHandlerFactoryUnsupportedEncodingExceptionpublic ContentHandler getNewContentHandler(OutputStream os, Charset charset)
getNewContentHandler in interface ContentHandlerFactorypublic BasicContentHandlerFactory.HANDLER_TYPE getType()
public int getWriteLimit()
getWriteLimit in interface WriteLimiterpublic boolean isThrowOnWriteLimitReached()
isThrowOnWriteLimitReached in interface WriteLimiterCopyright © 2007–2022 The Apache Software Foundation. All rights reserved.