|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object echopoint.ui.template.SGMLPageParser
SGMLPageParser
parses SGML markup'd pages and executes
active tags within. Returns its output
through a Element (given in a ParseContext).
Active Tags are handled with SpecialTagHandlers which can be registered for a specific Tag name.
The parsing is done via a two pass method. The first pass reads the input and keeps track of the positions and lengths of each active tag. If there is a tag handler for the tag, then the parseTag method is called.
The second pass involves executing the active tags. The static content is copied until the remembered position of a tag is encountered. Then the executeTag method is called for each stored active tag. The tag handler is then responsible for generating the output to be placed in that position.
DataSource objects will be cached to ensure the fast execution. The DataSource will be re-parsed if the lastModified data exceeds the stored time.
If a DataSource has already been broken into parts (step 1 parse) then this step will be skipped (as long as the last modified time is the same) and hence the template output will be rendered much faster.
Constructor Summary | |
SGMLPageParser()
Constructs a new SGMLPageParser. |
Method Summary | |
CompilationUnit |
compileDS(CompilationContext context,
DataSource source,
boolean forceCompilation)
Compiles a DataSource and returns a CompilationUnit representing the compiled data. |
static SGMLPageParser |
getInstance()
Returns a singleton instance of this PageParser. |
java.util.Iterator |
getRegisteredTags()
|
void |
process(DataSource source,
CompilationContext compilationContext,
ParseContext parseContext)
Process a general DataStore representing a Template |
void |
process(java.io.File file,
CompilationContext compilationContext,
ParseContext parseContext)
Processes a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SGMLPageParser()
Method Detail |
public CompilationUnit compileDS(CompilationContext context, DataSource source, boolean forceCompilation) throws java.io.IOException
If DataSource has changed or has not yet been loaded, load it and chop into sections, storing result for future use. Otherwise, return stored preprocessed page.
If the Component properties have not been set, according to the CompilationContext, then they will be set during this call.
java.io.IOException
public java.util.Iterator getRegisteredTags()
public void process(DataSource source, CompilationContext compilationContext, ParseContext parseContext) throws java.io.IOException
java.io.IOException
public void process(java.io.File file, CompilationContext compilationContext, ParseContext parseContext) throws java.io.IOException
java.io.IOException
public static SGMLPageParser getInstance()
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |