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
Fields Modifier and Type Field Description protected ContentHandler
_contentHandler
The content handler where to writeprotected boolean
_inUnmodifiableContent
True if the current HTML should not be modified Use to prevent to apply transformation on sax events (eg: HTML expert)protected LexicalHandler
_lexicalHandler
The lexical handler where to writestatic String
PROCESSING_INSTRUCTION_UNMODIFIABLE
Processing instruction for unmodifiable content
-
Constructor Summary
Constructors Constructor Description AbstractEnhancementHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
comment(char[] ch, int start, int length)
void
endCDATA()
void
endDocument()
void
endDTD()
void
endElement(String uri, String localName, String qName)
void
endEntity(String name)
void
endPrefixMapping(String prefix)
void
ignorableWhitespace(char[] ch, int start, int length)
void
processingInstruction(String target, String data)
protected void
saxError(I18nizableText title, I18nizableText message, String absoluteIconPath)
SAX an error message in content.void
setContentHandler(ContentHandler contentHandler)
Set the target content handlervoid
setDocumentLocator(Locator locator)
void
setLexicalHandler(LexicalHandler lexicalHandler)
Set the target lexical handlervoid
skippedEntity(String name)
void
startCDATA()
void
startDocument()
void
startDTD(String name, String publicId, String systemId)
void
startElement(String uri, String localName, String qName, Attributes atts)
void
startEntity(String name)
void
startPrefixMapping(String prefix, String uri)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
PROCESSING_INSTRUCTION_UNMODIFIABLE
public static final String PROCESSING_INSTRUCTION_UNMODIFIABLE
Processing instruction for unmodifiable content- See Also:
- Constant Field Values
-
_contentHandler
protected ContentHandler _contentHandler
The content handler where to write
-
_lexicalHandler
protected LexicalHandler _lexicalHandler
The lexical handler where to write
-
_inUnmodifiableContent
protected boolean _inUnmodifiableContent
True if the current HTML should not be modified Use to prevent to apply transformation on sax events (eg: HTML expert)
-
-
Constructor Detail
-
AbstractEnhancementHandler
public AbstractEnhancementHandler()
-
-
Method Detail
-
setContentHandler
public void setContentHandler(ContentHandler contentHandler)
Set the target content handler- Parameters:
contentHandler
- the target content handler
-
setLexicalHandler
public void setLexicalHandler(LexicalHandler lexicalHandler)
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
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- Specified by:
endEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException
- Specified by:
startCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException
- Specified by:
endCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXException
- Specified by:
endDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXException
- Specified by:
comment
in interfaceLexicalHandler
- Throws:
SAXException
-
-