com.jxml.quick.model.qjml
Class QMQJML

java.lang.Object
  |
  +--com.jxml.quick.model.qjml.QMCloneable
        |
        +--com.jxml.quick.model.qjml.QMQJML
All Implemented Interfaces:
Cloneable, QName

public class QMQJML
extends QMCloneable
implements QName

A model for the qjml element, which is the root element of the QJML binding schema. Every QJML document contains exactly one qjml element, which is the top-level (or outer-most) element of the document.

DTD:

<!ELEMENT qjml (include*, excludes*, (interface|abstract|text|bean|link)*)>

<!ATTLIST qjml
root CDATA #REQUIRED
SYSTEM CDATA #IMPLIED
PUBLIC CDATA #IMPLIED
JAR CDATA #IMPLIED
ID id #IMPLIED
>


Field Summary
 TreeMap coinMap
           A table of all the coins in the document, along with the coins of all included documents.
 ArrayList coins
           A container for the objects which model the coins elements, which are optional and repeating.
 TreeMap contentMap
           A table of all the contentModels.
 ArrayList excludeses
           A container for the objects which model excludes elements, which are optional and repeating.
 ArrayList includes
           A container for the Strings which model include elements, which are optional and repeating.
 String JAR
           Models the attribute JAR, an optional attribute on the qjml element.
 String PUBLIC
           Models the attribute PUBLIC, an optional attribute on the qjml element.
 String root
           Models the attribute root, a required attribute on the qjml element.
 String SYSTEM
           Models the attribute SYSTEM, an optional attribute on the qjml element.
 String tagName
          XML tag name for the qjml element.
 
Constructor Summary
QMQJML()
           
 
Method Summary
 void buildMaps(Map coinMap, Map contentMap)
           Builds the maps.
 Object clone()
          Returns a deep copy of this object, but in an uninitialized form.
 String getQName()
          Returns the tag name.
 void init()
           Initializes the data model.
 void setQName(String name)
          Sets the tag name.
 
Methods inherited from class com.jxml.quick.model.qjml.QMCloneable
clone, clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tagName

public String tagName
XML tag name for the qjml element. The value is almost always "qjml".

root

public String root

Models the attribute root, a required attribute on the qjml element. The root attribute must uniquely name the coin which specifies the top-level element (or elements) of the document type being defined by this QJML document.

Note that any coin which implements or extends the coin named by root can be used as a root element.


SYSTEM

public String SYSTEM

Models the attribute SYSTEM, an optional attribute on the qjml element. The SYSTEM attribute is a fully qualified URL, typically the URL of the DTD for the type of document which this QJML document implements.


PUBLIC

public String PUBLIC

Models the attribute PUBLIC, an optional attribute on the qjml element. The PUBLIC attribute is a URI naming the document type being defined.


JAR

public String JAR

Models the attribute JAR, an optional attribute on the qjml element. The JAR attribute names the jar file which holds the QJML document together with the classes referenced by the QJML document. this name should include a version number, allowing for the simultanious use of multiple versions.


includes

public ArrayList includes

A container for the Strings which model include elements, which are optional and repeating. During initialization of the model, the coins found in the QJML documents named by these Strings are included in the effective content of this QJML document. When coins with the same (otherwise) unique label or tag are found in more than one document, the last coin included is used. And when an included coin has the same name as a coin in this document, the coin in this document is chosen.

Inclusion is a recursive process, allowing for indirect inclusion to any depth.


excludeses

public ArrayList excludeses

A container for the objects which model excludes elements, which are optional and repeating. During initialization of the model, any coins that have been included which are named by an excludes element are dropped.

The coins in a QJML document are not effected by the excludes elements in that, or any included, document.


coins

public ArrayList coins

A container for the objects which model the coins elements, which are optional and repeating. (Coin elements are interface, abstract, text, bean, and link.)

This container is uneffected by the initialization process--it contains only coins defined in the current document.


coinMap

public transient TreeMap coinMap

A table of all the coins in the document, along with the coins of all included documents. Entries are ordered/keyed by each coin's unique label or tag name. This table is populated when the data model is initialized.


contentMap

public transient TreeMap contentMap

A table of all the contentModels. Entries are ordered/keyed by each contentModel's unique label. (ContentModel elements are item, sequence, and selection.) This table is populated when the data model is initialized.

Constructor Detail

QMQJML

public QMQJML()
Method Detail

clone

public Object clone()
Returns a deep copy of this object, but in an uninitialized form.
Overrides:
clone in class QMCloneable

getQName

public String getQName()
Returns the tag name.
Specified by:
getQName in interface QName

setQName

public void setQName(String name)
Sets the tag name.
Specified by:
setQName in interface QName

init

public void init()
          throws SAXException,
                 IOException

Initializes the data model. The init method on the QMQJML object must be called explicitly by the application which uses this data model. The init and buildMaps on the subordinate objects are called in turn.

This is a thread-safe method, allowing multiple applications to share the same data model. This is also a recursive method, calling init on all included QJML documents in turn.


buildMaps

public void buildMaps(Map coinMap,
                      Map contentMap)
               throws SAXException

Builds the maps. This method is called during initialization of the data model.