OpMath

com.opmath.util.dmldoc
Class DMLDoc

java.lang.Object
  |
  +--com.opmath.util.dmldoc.DMLDocBlock
        |
        +--com.opmath.util.dmldoc.DMLDoc

public class DMLDoc
extends DMLDocBlock

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.

Since:
J2SE 1.3
Version:
DMLDoc v2.0
Author:
Bruno Beloff bruno.beloff@opmath.com
See Also:
DMLDocBlock, DMLDocText

Field Summary
 ComparableTable model
           
 
Fields inherited from class com.opmath.util.dmldoc.DMLDocBlock
CMD_ENDIF, CMD_ENDLOOP, CMD_IF, CMD_IFDATA, CMD_IFNODATA, CMD_IFNOT, CMD_LOOP, CMD_SUB, DELIMITERS, EOL
 
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
 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.
 
Methods inherited from class com.opmath.util.dmldoc.DMLDocBlock
parse, toString, view, view, viewNames, viewNames, viewWithException
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

model

public ComparableTable model
Constructor Detail

DMLDoc

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.

Parameters:
inputText - the BufferedReader for the template.
Throws:
DMLDocBuildException - An exception thrown if the template text contained ill-formed commands.
Since:
J2SE 1.3
See Also:
DMLDoc(String, String)

DMLDoc

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.

Parameters:
inputStrm - the InputStream for the template.
Throws:
DMLDocBuildException - An exception thrown if the template text contained ill-formed commands.
Since:
J2SE 1.3
See Also:
DMLDoc(String, String)

DMLDoc

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.

Parameters:
pathName - the path the template file (with the trailing directory delimiter).
fileName - the name for the template file, with suffix.
Throws:
DMLDocBuildException - an exception thrown if the template file was missing or contained ill-formed commands.
Since:
J2SE 1.3
Method Detail

view

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.

Returns:
a new String containing the instantiated SGML template.
Since:
J2SE 1.3

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK