Class SemanticAnnotationsEditionHandler
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.transformation.htmledition.AbstractHTMLEditionHandler
-
- org.ametys.cms.transformation.htmledition.SemanticAnnotationsEditionHandler
-
- All Implemented Interfaces:
Contextualizable,LogEnabled,Serviceable,ContentHandler,LexicalHandler
public class SemanticAnnotationsEditionHandler extends AbstractHTMLEditionHandler
This transformer extracts semantic annotation from the incoming HTML for further processing. Appends all text nodes inside <span annotation="xxx"< element.
-
-
Field Summary
-
Fields inherited from class org.ametys.cms.transformation.htmledition.AbstractHTMLEditionHandler
_contentHandler, _context, _lexicalHandler, _manager
-
-
Constructor Summary
Constructors Constructor Description SemanticAnnotationsEditionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Dispatch the characters event to semanticAnnotations.voidendElement(String uri, String loc, String raw)Dispatch the endElement event to semanticAnnotations.voidstartDocument()When document starts, a holder of semanticAnnotations is createdvoidstartElement(String uri, String loc, String raw, Attributes attrs)Dispatch the startElement event to semanticAnnotations.-
Methods inherited from class org.ametys.cms.transformation.htmledition.AbstractHTMLEditionHandler
comment, contextualize, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, service, setContentHandler, setDocumentLocator, setLexicalHandler, skippedEntity, startCDATA, startDTD, startEntity, startPrefixMapping
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
SemanticAnnotationsEditionHandler
public SemanticAnnotationsEditionHandler()
-
-
Method Detail
-
startDocument
public void startDocument() throws SAXException
When document starts, a holder of semanticAnnotations is created- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classAbstractHTMLEditionHandler- Throws:
SAXException- See Also:
AbstractHTMLEditionHandler.startDocument()
-
startElement
public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
Dispatch the startElement event to semanticAnnotations. Add a new annotation in the holder if the element matches a semantic annotation element- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classAbstractHTMLEditionHandler- Throws:
SAXException- See Also:
AbstractHTMLEditionHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
Dispatch the characters event to semanticAnnotations.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classAbstractHTMLEditionHandler- Throws:
SAXException- See Also:
AbstractHTMLEditionHandler.characters(char[], int, int)
-
endElement
public void endElement(String uri, String loc, String raw) throws SAXException
Dispatch the endElement event to semanticAnnotations.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classAbstractHTMLEditionHandler- Throws:
SAXException- See Also:
AbstractHTMLEditionHandler.characters(char[], int, int)
-
-