Class AbstractTemplateHandler
- All Implemented Interfaces:
ITemplateHandler
- Direct Known Subclasses:
ModelBuilderTemplateHandler,OutputTemplateHandler
Basic abstract implementation of ITemplateHandler that takes care of the whole contract of this
interface and offers a good base for the easy implementation of custom template handlers.
All handleX() implementations in this class are set to simply delegate to the
next handler in the chain, so that subclasses can override only the handling methods that are
really relevant to them.
- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate a new instance of this handler, not specifying the 'next' handler.protectedCreate a new instance of this handler, specifying the handler that will be used as next step in the chain. -
Method Summary
Modifier and TypeMethodDescriptionprotected final ITemplateContextReturn the processing context corresponding to the template execution for which the template handler instance has been created.protected final ITemplateHandlergetNext()Return the next handler in the chain, so that events can be delegated to it.voidhandleCDATASection(ICDATASection cdataSection) voidhandleCloseElement(ICloseElementTag closeElementTag) voidhandleComment(IComment comment) voidhandleDocType(IDocType docType) voidhandleOpenElement(IOpenElementTag openElementTag) voidhandleProcessingInstruction(IProcessingInstruction processingInstruction) voidhandleStandaloneElement(IStandaloneElementTag standaloneElementTag) voidhandleTemplateEnd(ITemplateEnd templateEnd) voidhandleTemplateStart(ITemplateStart templateStart) voidhandleText(IText text) voidhandleXMLDeclaration(IXMLDeclaration xmlDeclaration) voidsetContext(ITemplateContext context) Set the processing context to be used, including template name, context, and also the engine configuration.voidsetNext(ITemplateHandler next) Set the next handler in the chain, so that events can be (optionally) delegated to it.
-
Constructor Details
-
AbstractTemplateHandler
Create a new instance of this handler, specifying the handler that will be used as next step in the chain.
- Parameters:
next- the next step in the chain.
-
AbstractTemplateHandler
protected AbstractTemplateHandler()Create a new instance of this handler, not specifying the 'next' handler.
-
-
Method Details
-
setNext
Set the next handler in the chain, so that events can be (optionally) delegated to it.
This method is called when the chain of template handlers is conformed, always before starting the parsing and processing of a template.
- Specified by:
setNextin interfaceITemplateHandler- Parameters:
next- the next handler in the chain.
-
setContext
Set the processing context to be used, including template name, context, and also the engine configuration.
This method is called always before starting the parsing and processing of a template.
- Specified by:
setContextin interfaceITemplateHandler- Parameters:
context- the processing context.
-
getNext
Return the next handler in the chain, so that events can be delegated to it.
- Returns:
- the next handler in the chain.
-
getContext
Return the processing context corresponding to the template execution for which the template handler instance has been created.
- Returns:
- the processing context
-
handleTemplateStart
- Specified by:
handleTemplateStartin interfaceITemplateHandler
-
handleTemplateEnd
- Specified by:
handleTemplateEndin interfaceITemplateHandler
-
handleXMLDeclaration
- Specified by:
handleXMLDeclarationin interfaceITemplateHandler
-
handleDocType
- Specified by:
handleDocTypein interfaceITemplateHandler
-
handleCDATASection
- Specified by:
handleCDATASectionin interfaceITemplateHandler
-
handleComment
- Specified by:
handleCommentin interfaceITemplateHandler
-
handleText
- Specified by:
handleTextin interfaceITemplateHandler
-
handleStandaloneElement
- Specified by:
handleStandaloneElementin interfaceITemplateHandler
-
handleOpenElement
- Specified by:
handleOpenElementin interfaceITemplateHandler
-
handleCloseElement
- Specified by:
handleCloseElementin interfaceITemplateHandler
-
handleProcessingInstruction
- Specified by:
handleProcessingInstructionin interfaceITemplateHandler
-