Class BasicContentHandlerFactory

    • Constructor Detail

      • BasicContentHandlerFactory

        public BasicContentHandlerFactory​(BasicContentHandlerFactory.HANDLER_TYPE type,
                                          int writeLimit)
        Parameters:
        type - basic type of handler
        writeLimit - 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 parse
        defaultType - type to return if parse fails
        Returns:
        handler type
      • getNewContentHandler

        public org.xml.sax.ContentHandler getNewContentHandler​(java.io.OutputStream os,
                                                               java.lang.String encoding)
                                                        throws java.io.UnsupportedEncodingException
        Specified by:
        getNewContentHandler in interface ContentHandlerFactory
        Throws:
        java.io.UnsupportedEncodingException
      • getNewContentHandler

        public org.xml.sax.ContentHandler getNewContentHandler​(java.io.OutputStream os,
                                                               java.nio.charset.Charset charset)
        Specified by:
        getNewContentHandler in interface ContentHandlerFactory
      • getWriteLimit

        public int getWriteLimit()