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 voidcharacters(char[] ch, int start, int length)voidendDocument()voidendElement(String uri, String localName, String qName)voidendPrefixMapping(String prefix)HTMLContentgetBodyHtmlContent()List<PageComponent>getGeneratedComponents()PageComponents are extracted from the input HTML stream on the basis of the parameterized component divs and theTagHandlers registered with theTagHandlerProviderHTMLContentgetHeadHtmlContent()StringgetLanguage()voidignorableWhitespace(char[] ch, int start, int length)voidprocessingInstruction(String target, String data)voidsetCanvasResourceType(String canvasResourceType)Sets the unique canvas resourceTypevoidsetDesignImporterContext(DesignImporterContext designImporterContext)Sets the design importer contextvoidsetDocumentLocator(Locator locator)voidsetPageBuilder(PageBuilder pageBuilder)Sets the page builder for building page components.voidsetTagHandlerProvider(TagHandlerProvider tagHandlerProvider)Sets theTagHandlerProvidervoidskippedEntity(String name)voidstartDocument()voidstartElement(String uri, String localName, String qName, Attributes atts)voidstartPrefixMapping(String prefix, String uri)
-
-
-
Method Detail
-
characters
public void characters(char[] ch, int start, int length) throws SAXException- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
getBodyHtmlContent
public HTMLContent getBodyHtmlContent()
-
getGeneratedComponents
public List<PageComponent> getGeneratedComponents()
PageComponents are extracted from the input HTML stream on the basis of the parameterized component divs and theTagHandlers registered with theTagHandlerProvider- Returns:
- The list of
PageComponents 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:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
setCanvasResourceType
public void setCanvasResourceType(String canvasResourceType)
Sets the unique canvas resourceType- Parameters:
canvasResourceType-
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
setDesignImporterContext
public void setDesignImporterContext(DesignImporterContext designImporterContext)
Sets the design importer context- Parameters:
designImporterContext- TheDesignImporterContextcontext object
-
setPageBuilder
public void setPageBuilder(PageBuilder pageBuilder)
Sets the page builder for building page components.- Parameters:
pageBuilder- ThePageBuilderobject for buildingPageComponents
-
setTagHandlerProvider
public void setTagHandlerProvider(TagHandlerProvider tagHandlerProvider)
Sets theTagHandlerProvider- Parameters:
tagHandlerProvider- TheTagHandlerProviderinstance
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
startDocument
public void startDocument() throws SAXException- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
-