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
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) Dispatch the characters event to semanticAnnotations.void
endElement
(String uri, String loc, String raw) Dispatch the endElement event to semanticAnnotations.void
When document starts, a holder of semanticAnnotations is createdvoid
startElement
(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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
SemanticAnnotationsEditionHandler
public SemanticAnnotationsEditionHandler()
-
-
Method Details
-
startDocument
When document starts, a holder of semanticAnnotations is created- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classAbstractHTMLEditionHandler
- Throws:
SAXException
- See Also:
-
startElement
Dispatch the startElement event to semanticAnnotations. Add a new annotation in the holder if the element matches a semantic annotation element- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classAbstractHTMLEditionHandler
- Throws:
SAXException
- See Also:
-
characters
Dispatch the characters event to semanticAnnotations.- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classAbstractHTMLEditionHandler
- Throws:
SAXException
- See Also:
-
endElement
Dispatch the endElement event to semanticAnnotations.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classAbstractHTMLEditionHandler
- Throws:
SAXException
- See Also:
-