Class HTMLContentHandler
- java.lang.Object
-
- com.day.cq.wcm.designimporter.parser.HTMLContentHandler
-
- All Implemented Interfaces:
ContentHandler
public class HTMLContentHandler extends Object implements ContentHandler
The SAX content handler for handling the HTML SAX events raised by the HTML parser.
-
-
Constructor Summary
Constructors Constructor Description HTMLContentHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endDocument()
void
endElement(String uri, String localName, String qName)
void
endPrefixMapping(String prefix)
HTMLContent
getBodyHtmlContent()
List<PageComponent>
getGeneratedComponents()
PageComponent
s are extracted from the input HTML stream on the basis of the parameterized component divs and theTagHandler
s registered with theTagHandlerProvider
HTMLContent
getHeadHtmlContent()
String
getLanguage()
void
ignorableWhitespace(char[] ch, int start, int length)
void
processingInstruction(String target, String data)
void
setCanvasResourceType(String canvasResourceType)
Sets the unique canvas resourceTypevoid
setDesignImporterContext(DesignImporterContext designImporterContext)
Sets the design importer contextvoid
setDocumentLocator(Locator locator)
void
setPageBuilder(PageBuilder pageBuilder)
Sets the page builder for building page components.void
setTagHandlerProvider(TagHandlerProvider tagHandlerProvider)
Sets theTagHandlerProvider
void
skippedEntity(String name)
void
startDocument()
void
startElement(String uri, String localName, String qName, Attributes atts)
void
startPrefixMapping(String prefix, String uri)
-
-
-
Method Detail
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
getBodyHtmlContent
public HTMLContent getBodyHtmlContent()
-
getGeneratedComponents
public List<PageComponent> getGeneratedComponents()
PageComponent
s are extracted from the input HTML stream on the basis of the parameterized component divs and theTagHandler
s registered with theTagHandlerProvider
- Returns:
- The list of
PageComponent
s extracted from the input HTML stream.
-
getHeadHtmlContent
public HTMLContent getHeadHtmlContent()
-
getLanguage
public String getLanguage()
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
setCanvasResourceType
public void setCanvasResourceType(String canvasResourceType)
Sets the unique canvas resourceType- Parameters:
canvasResourceType
-
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
setDesignImporterContext
public void setDesignImporterContext(DesignImporterContext designImporterContext)
Sets the design importer context- Parameters:
designImporterContext
- TheDesignImporterContext
context object
-
setPageBuilder
public void setPageBuilder(PageBuilder pageBuilder)
Sets the page builder for building page components.- Parameters:
pageBuilder
- ThePageBuilder
object for buildingPageComponent
s
-
setTagHandlerProvider
public void setTagHandlerProvider(TagHandlerProvider tagHandlerProvider)
Sets theTagHandlerProvider
- Parameters:
tagHandlerProvider
- TheTagHandlerProvider
instance
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-
startDocument
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
-