Package org.ametys.cms.transformation
Class AbstractEnhancementHandler
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.transformation.AbstractEnhancementHandler
- All Implemented Interfaces:
LogEnabled,ContentHandler,LexicalHandler
- Direct Known Subclasses:
DataInclusionEnhancementHandler,DefinitionEnhancementHandler
public abstract class AbstractEnhancementHandler
extends AbstractLogEnabled
implements ContentHandler, LexicalHandler
This interface is for component that wants to be in the docbook pipeline.
As a pipeline you receive events (from the ContentHandler and LexicalHandler interfaces)
you may transform it and write it to the given contentHandler (setContentHandler) and
given lexicalHandler (setLexicalHandler)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentHandlerThe content handler where to writeprotected booleanTrue if the current HTML should not be modified Use to prevent to apply transformation on sax events (eg: HTML expert)protected LexicalHandlerThe lexical handler where to writestatic final StringProcessing instruction for unmodifiable content -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidcomment(char[] ch, int start, int length) voidendCDATA()voidvoidendDTD()voidendElement(String uri, String localName, String qName) voidvoidendPrefixMapping(String prefix) voidignorableWhitespace(char[] ch, int start, int length) voidprocessingInstruction(String target, String data) protected voidsaxError(I18nizableText title, I18nizableText message, String absoluteIconPath) SAX an error message in content.voidsetContentHandler(ContentHandler contentHandler) Set the target content handlervoidsetDocumentLocator(Locator locator) voidsetLexicalHandler(LexicalHandler lexicalHandler) Set the target lexical handlervoidskippedEntity(String name) voidvoidvoidvoidstartElement(String uri, String localName, String qName, Attributes atts) voidstartEntity(String name) voidstartPrefixMapping(String prefix, String uri) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
PROCESSING_INSTRUCTION_UNMODIFIABLE
Processing instruction for unmodifiable content- See Also:
-
_contentHandler
The content handler where to write -
_lexicalHandler
The lexical handler where to write -
_inUnmodifiableContent
True if the current HTML should not be modified Use to prevent to apply transformation on sax events (eg: HTML expert)
-
-
Constructor Details
-
AbstractEnhancementHandler
public AbstractEnhancementHandler()
-
-
Method Details
-
setContentHandler
Set the target content handler- Parameters:
contentHandler- the target content handler
-
setLexicalHandler
Set the target lexical handler- Parameters:
lexicalHandler- the target lexical handler
-
saxError
protected void saxError(I18nizableText title, I18nizableText message, String absoluteIconPath) throws SAXException SAX an error message in content.- Parameters:
title- the error title. Can be null.message- the error message. Can be null.absoluteIconPath- the absolute path of the icon. Can be null.- Throws:
SAXException- if an error occurred while SAXing
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Throws:
SAXException
-
startEntity
- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
- Specified by:
endEntityin interfaceLexicalHandler- Throws:
SAXException
-
startCDATA
- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endCDATA
- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
startDTD
- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
comment
- Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-