| java.lang.Object org.wings.template.parser.PageParser
PageParser | public class PageParser (Code) | | PageParser
parses SGML markup'd pages and executes
active Tag. Returns its output
through a HttpServletResponse (given in a ParseContext).
Active Tags are handled with SpecialTagHandlers which
can be registered for a specific Tag.
Error handling:
To simplify error detection and correction,
exceptions thrown by the executeTag() -methods of the
pluggable handlers (e.g. called servlets) are printed,
enclosed in comments ("<!-- ... -->"), in the HTML output.
author: Henner Zeller See Also: javax.servlet.http.HttpServlet |
Constructor Summary | |
public | PageParser() Constructs a new PageParser. |
Method Summary | |
public void | addTagHandler(String tagname, String handlerClassName) register a handler for a specific tag (Class name).
Tags are case-insensitive.
Parameters: tagname - the name of the tag like 'MYSPECIALTAG' or 'SERVLET' Parameters: handlerClassName - the name of class implementing theaction for this tag. | public void | addTagHandler(String tagname, Class handlerClass) register a handler for a specific tag (Class).
Tags are case-insensitive.
Parameters: tagname - the name of the tag like 'MYSPECIALTAG' or 'SERVLET' Parameters: handlerClass - the class implementing theaction for this tag. | public static PageParser | getInstance() returns a singleton instance of this PageParser. | public Map | getLabels(TemplateSource source) | public Iterator | getRegisteredTags() | public void | process(TemplateSource source, ParseContext context) | public void | process(File file, ParseContext context) Processes a file. |
PageParser | public PageParser()(Code) | | Constructs a new PageParser.
|
addTagHandler | public void addTagHandler(String tagname, String handlerClassName) throws ClassNotFoundException(Code) | | register a handler for a specific tag (Class name).
Tags are case-insensitive.
Parameters: tagname - the name of the tag like 'MYSPECIALTAG' or 'SERVLET' Parameters: handlerClassName - the name of class implementing theaction for this tag. This class mustimplement the SpecialTagHandlerinterface. throws: ClassNotFoundException - if the class with the specifiedname is not found. |
addTagHandler | public void addTagHandler(String tagname, Class handlerClass)(Code) | | register a handler for a specific tag (Class).
Tags are case-insensitive.
Parameters: tagname - the name of the tag like 'MYSPECIALTAG' or 'SERVLET' Parameters: handlerClass - the class implementing theaction for this tag. This class mustimplement the SpecialTagHandlerinterface. |
getInstance | public static PageParser getInstance()(Code) | | returns a singleton instance of this PageParser.
You usually want to use the singleton instance to make
use of a central cache.
|
getRegisteredTags | public Iterator getRegisteredTags()(Code) | | Itearator of all Tags which are special tothis PageParser |
process | public void process(TemplateSource source, ParseContext context) throws IOException(Code) | | Process a general DataStore representing a Template
Parameters: source - The template TemplateSource Parameters: context - The context used while parsing; containsat least the HttpServletRequest andHttpServletResponse. See Also: ParseContext See Also: TemplateSource |
process | public void process(File file, ParseContext context) throws IOException(Code) | | Processes a file.
Parameters: file - The file containing SGML markup Parameters: context - The context used while parsing; containsat least the HttpServletRequest and HttpServletResponse. See Also: ParseContext |
|
|