|
OpMath | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.opmath.util.dmldoc.DMLDocBlock
|
+--com.opmath.util.dmldoc.DMLDoc
The Document Object Model (DOM) for the template.
DMLDoc provides a simple, efficient and highly-functional method
for generating dynamic Web pages, or other dynamic SGML documents. This enables
a flexible approach to constructing Web sites using Java Servlets, Enterprise
Java Beans, and any other appropriate Java technology. The approach is independent
of the choice of Web server, Java applications server or server-side database.
DMLDoc provides the highest-level view of the
com.opmath.util.dmldoc structures. This includes the DOM, together
with a ComparableTable for holding tabluar data, known as the
DMLDoc model.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
DMLDocBlock,
DMLDocText| Field Summary | |
protected static String |
CMD_ENDIF
The String identifying the DMLDoc ENDIF command. |
protected static String |
CMD_ENDLOOP
The String identifying the DMLDoc ENDLOOP command. |
protected static String |
CMD_IF
The String identifying the DMLDoc IF command. |
protected static String |
CMD_IFDATA
The String identifying the DMLDoc IFDATAFOR command. |
protected static String |
CMD_IFNODATA
The String identifying the DMLDoc IFNODATAFOR
command. |
protected static String |
CMD_IFNOT
The String identifying the DMLDoc IFNOT command. |
protected static String |
CMD_LOOP
The String identifying the DMLDoc LOOP command. |
protected static String |
CMD_SUB
The String identifying the DMLDoc SUB command. |
protected static String |
DELIMITERS
The delimiters used to identify the DMLDoc command tokens in the template source. |
protected static String |
EOL
The end-of-line character or characters for the server operating system. |
ComparableTable |
model
|
| Constructor Summary | |
DMLDoc(BufferedReader viewReader)
Constructs a DMLDoc for a given BufferedReader. |
|
DMLDoc(InputStream viewStream)
Constructs a DMLDoc for a given InputStream. |
|
DMLDoc(String viewPath,
String viewFile)
Constructs a DMLDoc for the text found in the named file. |
|
| Method Summary | |
protected void |
parse(BufferedReader viewReader)
Constructs the DMLDocBlock according to the text supplied
by the given BufferedReader. |
String |
toString()
Returns a formatted string representaion of the DMLDocBlock
instance. |
String |
view()
Returns a String representaion of this DMLDoc
instance, with the various SUBs, LOOPs and IF / IFNOT / IFDATAFOR / IFNODATAFOR
elements processed, as determined by the contents of the model. |
String |
view(ComparableTable model)
Returns a String representaion of the DMLDocBlock
instance, with the various SUBs, LOOPs and IF / IFNOT / IFDATAFOR / IFNODATAFOR
elements processed, as determined by the contents of the
com.opmath.util.datastruct.ComparableTable. |
protected String |
view(ComparableTable model,
int mode,
int loopIndex)
Returns a String representaion of the DMLDocBlock
instance, with the various SUBs, LOOPs and IF / IFNOT / IFDATAFOR / IFNODATAFOR
elements processed, as determined by the contents of the
com.opmath.util.datastruct.ComparableTable. |
ComparableList |
viewNames()
Returns a ComparableList containing one Object
for each of the SUB and IF / IFNOT / IFDATAFOR / IFNODATAFOR source names
found in the SGML template file. |
protected ComparableList |
viewNames(ComparableList sourceList)
Updates the com.opmath.util.datastruct.ComparableList with
one Object for each of the SUB and IF / IFNOT / IFDATAFOR /
IFNODATAFOR sources found in the SGML template file (if any). |
String |
viewWithException(ComparableTable model)
Returns a String representaion of the DMLDocBlock
instance, with the various SUBs, LOOPs and IF / IFNOT / IFDATAFOR / IFNODATAFOR
elements processed, as determined by the contents of the
com.opmath.util.datastruct.ComparableTable. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public ComparableTable model
protected static final String DELIMITERS
The delimiters used to identify the DMLDoc command tokens in the template source. Used by the DMLDoc parser.
Set to "\t\n\r #/|%,.;:'?=&\"<>[]{}".
protected static final String EOL
The end-of-line character or characters for the server operating system. Used by the DMLDoc parser, instantiator, and exception reporting methods.
Set to System.getProperty("line.separator").
protected static final String CMD_SUB
The String identifying the DMLDoc SUB command.
Used by the parser. Note that this parser is not case-sensitive for these
commands.
Set to "SUB".
protected static final String CMD_IF
The String identifying the DMLDoc IF command.
Used by the parser. Note that this parser is not case-sensitive for these
commands.
Set to "IF".
protected static final String CMD_IFNOT
The String identifying the DMLDoc IFNOT command.
Used by the parser. Note that this parser is not case-sensitive for these
commands.
Set to "IFNOT".
protected static final String CMD_IFDATA
The String identifying the DMLDoc IFDATAFOR command.
Used by the parser. Note that this parser is not case-sensitive for these
commands.
Set to "IFDATAFOR".
protected static final String CMD_IFNODATA
The String identifying the DMLDoc IFNODATAFOR
command. Used by the parser. Note that this parser is not case-sensitive
for these commands.
Set to "IFNODATAFOR".
protected static final String CMD_ENDIF
The String identifying the DMLDoc ENDIF command.
Used by the parser. Note that this parser is not case-sensitive for these
commands.
Set to "ENDIF".
protected static final String CMD_LOOP
The String identifying the DMLDoc LOOP command.
Used by the parser. Note that this parser is not case-sensitive for these
commands.
Set to "LOOP".
protected static final String CMD_ENDLOOP
The String identifying the DMLDoc ENDLOOP command.
Used by the parser. Note that this parser is not case-sensitive for these
commands.
Set to "ENDLOOP".
| Constructor Detail |
public DMLDoc(BufferedReader viewReader)
throws DMLDocBuildException
Constructs a DMLDoc for a given BufferedReader.
It is anticipated that DMLDoc(String, String) will be the
most common way in which DMLDoc instances are created.
DMLDocBuildException - An exception thrown if
the template text contained ill-formed commands.DMLDoc(String, String)
public DMLDoc(InputStream viewStream)
throws DMLDocBuildException
Constructs a DMLDoc for a given InputStream.
It is anticipated that DMLDoc(String, String) will be the
most common way in which DMLDoc instances are created.
DMLDocBuildException - An exception thrown if
the template text contained ill-formed commands.DMLDoc(String, String)
public DMLDoc(String viewPath,
String viewFile)
throws DMLDocBuildException
Constructs a DMLDoc for the text found in the named file.
This node will be the root of a new DMLDoc.
It is anticipated that this will be the most common way in which
DMLDoc instances are created.
DMLDocBuildException - an exception thrown if
the template file was missing or contained ill-formed commands.| Method Detail |
public String view()
Returns a String representaion of this DMLDoc
instance, with the various SUBs, LOOPs and IF / IFNOT / IFDATAFOR / IFNODATAFOR
elements processed, as determined by the contents of the model.
If the model is malformed, view() attempts to return
a String containing an SGML-formatted report detailing the cause
of the problem. The template resource for this report is held at
com.opmath.util.dmldoc.tpl_DMLDocWriteException.html. This
template may be edited, but all of its SUB .. commands should remain
unaltered.
NOTE: If com.opmath.util.dmldoc.tpl_DMLDocWriteException.html
is not found, or is malformed, then view() reports to
System.err and returns an empty String.
String containing the instantiated SGML template.protected ComparableList viewNames(ComparableList sourceList)
Updates the com.opmath.util.datastruct.ComparableList with
one Object for each of the SUB and IF / IFNOT / IFDATAFOR /
IFNODATAFOR sources found in the SGML template file (if any).
It is anticipated that the alternative method - viewNames() -
will be the normal way in which DMLDocBlock view sources are
found.
sourceList - the ComparableList for the SUB and
IF / IFNOT / IFDATAFOR / IFNODATAFOR source names.
ComparableList of source names.DMLDocBlock.viewNames(com.opmath.util.datastruct.ComparableList),
DMLDocText.viewNames(com.opmath.util.datastruct.ComparableList)public ComparableList viewNames()
Returns a ComparableList containing one Object
for each of the SUB and IF / IFNOT / IFDATAFOR / IFNODATAFOR source names
found in the SGML template file.
If no substitution sources were found, viewNames() returns a
ComparableList with zero elements.
ComparableList of source names.
protected void parse(BufferedReader viewReader)
throws DMLDocBuildException
Constructs the DMLDocBlock according to the text supplied
by the given BufferedReader. If the source text contains
malformed commands, parse(BufferedReader) throws a
DMLDocBuildException.
viewReader - a BufferedReader carrying the source text.
ComparableList of source names.
DMLDocBuildException - An exception thrown if
the source text contained malformed commands.
protected String view(ComparableTable model,
int mode,
int loopIndex)
throws DMLDocWriteException
Returns a String representaion of the DMLDocBlock
instance, with the various SUBs, LOOPs and IF / IFNOT / IFDATAFOR / IFNODATAFOR
elements processed, as determined by the contents of the
com.opmath.util.datastruct.ComparableTable.
NOTE: This is a highly specialzed method, only called during recursive decents into the DOM.
model - the com.opmath.util.datastruct.ComparableTable representing the data set.mode - the int representing the function of this DMLDocBlock.loopIndex - the int representing the current row in the model.
String containing the instantiated DMLDocBlock.
DMLDocWriteException - An exception thrown if
the com.opmath.util.datastruct.ComparableTable was malformed.DMLDocBlock.view(com.opmath.util.datastruct.ComparableTable)
public String viewWithException(ComparableTable model)
throws DMLDocWriteException
Returns a String representaion of the DMLDocBlock
instance, with the various SUBs, LOOPs and IF / IFNOT / IFDATAFOR / IFNODATAFOR
elements processed, as determined by the contents of the
com.opmath.util.datastruct.ComparableTable.
If the com.opmath.util.datastruct.ComparableTable is malformed,
viewWithException(com.opmath.util.datastruct.ComparableTable)
raises a DMLDocWriteException exception.
model - the com.opmath.util.datastruct.ComparableTable
representing the data set.
String containing the instantiated DMLDocBlock.
DMLDocWriteException - An exception thrown if
the com.opmath.util.datastruct.ComparableTable was malformed.DMLDocBlock.view(com.opmath.util.datastruct.ComparableTable)public String view(ComparableTable model)
Returns a String representaion of the DMLDocBlock
instance, with the various SUBs, LOOPs and IF / IFNOT / IFDATAFOR / IFNODATAFOR
elements processed, as determined by the contents of the
com.opmath.util.datastruct.ComparableTable.
If the com.opmath.util.datastruct.ComparableTable is malformed,
view(com.opmath.util.datastruct.ComparableTable) attempts to
return a String containing an SGML-formatted report detailing
the cause of the problem. The template resource for this report is held
at com.opmath.util.dmldoc.tpl_DMLDocWriteException.html This
template may be edited, but all of its <!-- SUB .. -->
commands should remain unaltered.
NOTE: If com.opmath.util.dmldoc.tpl_DMLDocWriteException.html
is not found, or is malformed, then
view(com.opmath.util.datastruct.ComparableTable) reports to
System.err and returns an empty String.
model - the com.opmath.util.datastruct.ComparableTable
representing the data set.
String containing the instantiated SGML template.public String toString()
Returns a formatted string representaion of the DMLDocBlock
instance. No instantiation is performed, but the structure of the
DMLDocBlockinstance is revealed.
NOTE: Intended to be used for debugging tasks only. The format of the
output may change from one release of dmldoc to the next.
toString in class ObjectStringDMLDocBlock.view(com.opmath.util.datastruct.ComparableTable)
|
OpMath | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||