|
|||||||||
| Home >> All >> org >> enhydra >> xml >> xmlc >> [ compiler overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.enhydra.xml.xmlc.compiler
Class ElementTable

java.lang.Objectorg.enhydra.xml.xmlc.compiler.ElementTable
- public class ElementTable
- extends java.lang.Object
Table of information about each element.
| Field Summary | |
private int |
fDocumentNodeSize
The size of the document, in nodes. |
private java.util.Map |
fElements
List of all element info objects, indexed by Element object. |
private boolean |
fGlobalIdAttrMode
Is this global-id-attribute mode? |
private java.util.SortedMap |
fInvalidElementIds
Sorted table of element ids that are not legal Java identifiers. |
private java.util.SortedMap |
fJavaIds
Sorted map of Java ids to element info. |
private org.enhydra.xml.xmlc.metadata.MetaData |
fMetaData
Metadata object associated with document. |
private java.util.Map |
fTagName2ElementInfoList
Table of tag names to Lists of element info objects. |
private java.util.Map |
fTagName2IdAttrName
Table of tag name to id attribute names. |
private org.enhydra.xml.xmlc.dom.XMLCDocument |
fXmlcDoc
Container for document. |
private java.util.SortedMap |
fXmlIds
Sorted map of ids to element info. |
| Constructor Summary | |
ElementTable(org.enhydra.xml.xmlc.metadata.MetaData metaData,
org.enhydra.xml.xmlc.dom.XMLCDocument xmlcDoc)
Constructor. |
|
| Method Summary | |
private void |
addElement(org.w3c.dom.Element element,
int nodeSize,
int subTreeSize)
Add an element to the table. |
private int |
addElements(org.w3c.dom.Node node)
Recursively walk the DOM and enter all elements. |
int |
getDocumentNodeSize()
Get the size of the document, in nodes. |
ElementInfo |
getElementInfo(org.w3c.dom.Element element)
Look up an ElementInfo by Element. |
java.util.Iterator |
getElements()
Get a interator of all ElementInfo objects. |
java.util.Iterator |
getElementsByTagName(java.lang.String tagName)
Get an iterator of ElementInfo entries by tag name. |
java.lang.String |
getIdAttributeName(java.lang.String tagName)
Get the id-attribute name for a tag. |
java.util.Iterator |
getInvalidElementIds()
Get an sorted iterator of element ids that are not legal Java identifiers, or null if all ids were legal. |
java.util.Iterator |
getJavaIdElements()
Get an iterator of all ElementInfo objects that have Java ids. |
private int |
getNodeCount(org.w3c.dom.Node node)
Get the size of a single node (but not its children). |
private int |
getRecursiveNodeCount(org.w3c.dom.Node node)
Recursively determine node sizes |
java.util.Iterator |
getTagNames()
Get all tag names that were found in local-id-attribute mode. |
org.enhydra.xml.xmlc.dom.XMLCDocument |
getXMLCDocument()
Get the XMLCDocument object stored in the table. |
boolean |
isGlobalIdAttrMode()
Is there only one attribute name for all id attributes? |
private void |
recordLocalIdAttributeInfo(ElementInfo elementInfo,
org.w3c.dom.Element element)
Record information for local id-attribute mode. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
fXmlcDoc
private org.enhydra.xml.xmlc.dom.XMLCDocument fXmlcDoc
- Container for document.
fMetaData
private org.enhydra.xml.xmlc.metadata.MetaData fMetaData
- Metadata object associated with document.
fElements
private java.util.Map fElements
- List of all element info objects, indexed by Element object.
fXmlIds
private java.util.SortedMap fXmlIds
- Sorted map of ids to element info.
fJavaIds
private java.util.SortedMap fJavaIds
- Sorted map of Java ids to element info.
fInvalidElementIds
private java.util.SortedMap fInvalidElementIds
- Sorted table of element ids that are not legal Java identifiers.
Created when needed.
fGlobalIdAttrMode
private boolean fGlobalIdAttrMode
- Is this global-id-attribute mode?
fTagName2IdAttrName
private java.util.Map fTagName2IdAttrName
- Table of tag name to id attribute names. Null in
global-id-attribute mode.
fTagName2ElementInfoList
private java.util.Map fTagName2ElementInfoList
- Table of tag names to Lists of element info objects.
Null in global-id-attribute mode.
fDocumentNodeSize
private int fDocumentNodeSize
- The size of the document, in nodes.
| Constructor Detail |
ElementTable
public ElementTable(org.enhydra.xml.xmlc.metadata.MetaData metaData, org.enhydra.xml.xmlc.dom.XMLCDocument xmlcDoc) throws org.enhydra.xml.xmlc.XMLCException
- Constructor. Builds the table.
| Method Detail |
getRecursiveNodeCount
private int getRecursiveNodeCount(org.w3c.dom.Node node)
- Recursively determine node sizes
getNodeCount
private int getNodeCount(org.w3c.dom.Node node)
- Get the size of a single node (but not its children). Does
include attribute sizes.
recordLocalIdAttributeInfo
private void recordLocalIdAttributeInfo(ElementInfo elementInfo, org.w3c.dom.Element element)
- Record information for local id-attribute mode.
addElement
private void addElement(org.w3c.dom.Element element, int nodeSize, int subTreeSize) throws org.enhydra.xml.xmlc.XMLCException
- Add an element to the table.
addElements
private int addElements(org.w3c.dom.Node node) throws org.enhydra.xml.xmlc.XMLCException
- Recursively walk the DOM and enter all elements.
getXMLCDocument
public org.enhydra.xml.xmlc.dom.XMLCDocument getXMLCDocument()
- Get the XMLCDocument object stored in the table.
getDocumentNodeSize
public int getDocumentNodeSize()
- Get the size of the document, in nodes.
isGlobalIdAttrMode
public boolean isGlobalIdAttrMode()
- Is there only one attribute name for all id attributes?
getElementInfo
public ElementInfo getElementInfo(org.w3c.dom.Element element)
- Look up an ElementInfo by Element.
getElements
public java.util.Iterator getElements()
- Get a interator of all ElementInfo objects.
getJavaIdElements
public java.util.Iterator getJavaIdElements()
- Get an iterator of all ElementInfo objects that have Java ids.
getElementsByTagName
public java.util.Iterator getElementsByTagName(java.lang.String tagName)
- Get an iterator of ElementInfo entries by tag name.
Only valid in local-id-attribute mode.
getTagNames
public java.util.Iterator getTagNames()
- Get all tag names that were found in local-id-attribute mode.
Returns null in global-id-attribute mode.
getIdAttributeName
public java.lang.String getIdAttributeName(java.lang.String tagName)
- Get the id-attribute name for a tag.
getInvalidElementIds
public java.util.Iterator getInvalidElementIds()
- Get an sorted iterator of element ids that are not legal Java
identifiers, or null if all ids were legal.
|
|||||||||
| Home >> All >> org >> enhydra >> xml >> xmlc >> [ compiler overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.enhydra.xml.xmlc.compiler.ElementTable