DimDom v0.8.2

org.alltimeflashdreamer.dimdom
Class DimDom

java.lang.Object
  |
  +--org.alltimeflashdreamer.dimdom.DimDom

public final class DimDom
extends Object

Title: DimDom
Description: This is the "server core" of the DimDom engine. It works statically somewhere in the JVM and collects instances of XHTMLDocument implementing classes, each for one template source file or URL. If the print method is called, DimDom tries to initialize the processing class and then to call the processor method of this class. If the current instance is able to do its job, the fully qualified XHTML string is returned, else the appropriate exception is thrown.
To allow XHTMLSiteData implementing classes to test the programmer's input, DimDom provides the getTestDocument method which returns a fully qualified DOM tree, wrapped in a org.w3c.dom.Document instance. This Document may then be used to apply modifications of the DOM tree to find out whether the action leads to a DOMException or is fully XHTML compliant.


Field Summary
(package private) static String TESTDOCUMENT
          Stores a validateable XHTML String which is used to test the programmer's commands.
 
Method Summary
static void addDimDomDocument(String sIdentifier, XHTMLDocument doc)
          Adds a key/value pair to the internal list.
static XHTMLDocument getDimDomDocument(String sIdentifier)
          Returns the associated object to sIdentifier from within the internal list.
static Document getTestDocument()
          Returns a clone of the internal test document, ready to be used for e.g.
static String print(XHTMLSiteData siteData)
          Does everything that is necessary to be done to form a dynamically updated XHTML output out of the values defined in SiteData.
Therefore, the internal list of preloaded sites is checked against the String received from the XHTMLSiteData's getIdentifier method.
static void removeDimDomDocument(String sIdentifier)
          Removes the associated object of sIdentifier from within the internal list.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TESTDOCUMENT

static final String TESTDOCUMENT
Stores a validateable XHTML String which is used to test the programmer's commands. The validating DTD is the official one, provided by w3.org:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
Method Detail

print

public static String print(XHTMLSiteData siteData)
                    throws SAXException,
                           IOException,
                           DimDomException
Does everything that is necessary to be done to form a dynamically updated XHTML output out of the values defined in SiteData.
Therefore, the internal list of preloaded sites is checked against the String received from the XHTMLSiteData's getIdentifier method. If such an entry is found in the list, the object is received from the list and reused, else a new instance of the class received from the getXHTMLDocumentClass method is created.
Parameters:
siteData - a class that implements org.alltimeflashdreamer.dimdom.XHTMLSiteData
Returns:
the full XHTML string of the dynamically modified template
Throws:
SAXException - thrown by the parser
IOException - thrown by the parser (input source)
DimDomException - thrown by the processor, if something is/went wrong

getTestDocument

public static Document getTestDocument()
Returns a clone of the internal test document, ready to be used for e.g. testing purposes
Returns:
a fully XHTML compliant Document instance

getDimDomDocument

public static XHTMLDocument getDimDomDocument(String sIdentifier)
Returns the associated object to sIdentifier from within the internal list. If this list doesn't contain such a key, null is returned.
Parameters:
sIdentifier - as received by the getIdentifer method of the XHTMLSiteData interface
Returns:
the required instance of XHTMLDocument

addDimDomDocument

public static void addDimDomDocument(String sIdentifier,
                                     XHTMLDocument doc)
Adds a key/value pair to the internal list. If this list already contains such a key, the former value is overwritten.
Parameters:
sIdentifier - as received by the getIdentifer method of the XHTMLSiteData interface
doc - the required instance of XHTMLDocument

removeDimDomDocument

public static void removeDimDomDocument(String sIdentifier)
Removes the associated object of sIdentifier from within the internal list. If this list doesn't contain such a key, nothing is done.
Parameters:
sIdentifier - as received by the getIdentifer method of the XHTMLSiteData interface

Copyright (c) 2001/02 by Florian Steinsiepe