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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
SemanticAnnotationsEditionHandler.AbstractSaxedSemanticAnnotation
A semantic annotation defined through a serie of SAX events.private class
SemanticAnnotationsEditionHandler.SemanticAnnotationsHolder
A placeholder for saxedSemanticAnnotations Maintains a list of the saxedSemanticAnnotations.
-
Field Summary
Fields Modifier and Type Field Description private static String
__ANNOTATION_ATTRIBUTE
private static String
__ANNOTATION_TAG_NAME
(package private) SemanticAnnotationsEditionHandler.SemanticAnnotationsHolder
_annotationsHolder
-
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 void
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
startDocument()
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
-
-
-
-
Field Detail
-
__ANNOTATION_TAG_NAME
private static final String __ANNOTATION_TAG_NAME
- See Also:
- Constant Field Values
-
__ANNOTATION_ATTRIBUTE
private static final String __ANNOTATION_ATTRIBUTE
- See Also:
- Constant Field Values
-
_annotationsHolder
SemanticAnnotationsEditionHandler.SemanticAnnotationsHolder _annotationsHolder
-
-
Constructor Detail
-
SemanticAnnotationsEditionHandler
public SemanticAnnotationsEditionHandler()
-
-
Method Detail
-
startDocument
public void startDocument() throws SAXException
When document starts, a holder of semanticAnnotations is created- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in 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:
startElement
in interfaceContentHandler
- Overrides:
startElement
in 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:
characters
in interfaceContentHandler
- Overrides:
characters
in 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:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classAbstractHTMLEditionHandler
- Throws:
SAXException
- See Also:
AbstractHTMLEditionHandler.characters(char[], int, int)
-
-