Class InlineScriptTagHandler

  • All Implemented Interfaces:
    EntryTagHandler, HTMLContentProvider, TagHandler

    public class InlineScriptTagHandler
    extends java.lang.Object
    implements TagHandler, EntryTagHandler, HTMLContentProvider
    This tag handler is used to pull out the inline page scripts defined within the script tag(s) of the input HTML document.

    This tag handler is registered against the markup of type < script >. That implies this tag handler will come into action whenever the design importer framework encounters an HTML tag matching the rule this handler is defined against.

    See Also:
    InlineScriptTagHandlerFactory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void beginHandling​(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
      Callback to signal the start of handling giving the tag handler a chance for running intialization routines.
      void characters​(char[] ch, int start, int length)
      Callback to signal the encounter of character content within tags.
      void endElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName)
      Callback to signal the encounter of a tag end.
      void endHandling​(java.lang.String uri, java.lang.String localName, java.lang.String qName)
      Callback to signal the end of handling giving the tag handler a chance for finalizing things.
      java.lang.Object getContent​(HTMLContentType htmlContentType)
      Gets the content of the type HTMLContentType
      void setDesignImporterContext​(DesignImporterContext designImporterContext)
      Sets the design importer context
      void setTagHandlerProvider​(TagHandlerProvider tagHandlerProvider)  
      void startElement​(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
      Callback to signal the encounter of a tag start.
      boolean supportsContent​(HTMLContentType htmlContentType)
      Indicates whether the passed HTMLContentType is supported or not
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InlineScriptTagHandler

        public InlineScriptTagHandler()
    • Method Detail

      • beginHandling

        public void beginHandling​(java.lang.String uri,
                                  java.lang.String localName,
                                  java.lang.String qName,
                                  org.xml.sax.Attributes atts)
        Description copied from interface: TagHandler
        Callback to signal the start of handling giving the tag handler a chance for running intialization routines.

        TagHandlers are registered against tag+attribute combination and are invoked by the HTMLContentHandler as and when it encounters a tag matching the tag attribute combination the tag handler is registered with.

        Specified by:
        beginHandling in interface TagHandler
      • endHandling

        public void endHandling​(java.lang.String uri,
                                java.lang.String localName,
                                java.lang.String qName)
        Description copied from interface: TagHandler
        Callback to signal the end of handling giving the tag handler a chance for finalizing things.

        This is arguably the last callback a tag handler receives. After this, the current tag handler is popped out from the chain and the subsequent Tika events are directed to preceding tag handlers.

        Specified by:
        endHandling in interface TagHandler
      • startElement

        public void startElement​(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes atts)
                          throws DesignImportException
        Description copied from interface: TagHandler
        Callback to signal the encounter of a tag start.

        Once a tag handler begins handling, it receives the start tag events for all the nested tags within the purview of the tag this tag handler is registered against.

        Specified by:
        startElement in interface TagHandler
        Throws:
        DesignImportException