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 classSemanticAnnotationsEditionHandler.AbstractSaxedSemanticAnnotationA semantic annotation defined through a serie of SAX events.private classSemanticAnnotationsEditionHandler.SemanticAnnotationsHolderA placeholder for saxedSemanticAnnotations Maintains a list of the saxedSemanticAnnotations.
-
Field Summary
Fields Modifier and Type Field Description private static String__ANNOTATION_ATTRIBUTEprivate 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 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
-
-
-
-
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:
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)
-
-