public class TreeSpec extends DataStructureSpec
Constructor and Description |
---|
TreeSpec(org.w3c.dom.Element elem)
Construct a tree specification from an XML element
|
TreeSpec(java.lang.String specName)
Construct an empty graph specification with the given name
|
Modifier and Type | Method and Description |
---|---|
void |
addTemplate(java.lang.String templateName)
Add the template by name to the set of templates used for tree nodes in
this tree specification
|
java.lang.String |
getName()
Get the name for the particular data structure
|
java.lang.String |
getParentField()
Get the parentField for this tree
|
java.util.List<java.lang.String> |
getSplitFields()
Get the sequence of splitFields for this tree.
|
java.util.HashSet<java.lang.String> |
getTemplateNames()
Get the names of the templates identified for this specification.
|
void |
loadFromXml(org.w3c.dom.Element elem)
Load the Tree Specification from an XML element.
|
org.w3c.dom.Element |
toXml(org.w3c.dom.Document doc)
Convert this specification into XML format.
|
getTemplates, storeTemplates
public TreeSpec(org.w3c.dom.Element elem)
elem
- the element containing the tree specificationpublic TreeSpec(java.lang.String specName)
specName
- the name of the graph specificationpublic void addTemplate(java.lang.String templateName)
templateName
- the template namepublic java.lang.String getName()
getName
in class DataStructureSpec
public java.lang.String getParentField()
public java.util.List<java.lang.String> getSplitFields()
public java.util.HashSet<java.lang.String> getTemplateNames()
getTemplateNames
in class DataStructureSpec
public void loadFromXml(org.w3c.dom.Element elem)
treeNodeClass
, and may be a
space-separated sequence of template names. The splitFields
attribute specifies a comma-separated sequence of fields which split the
tree at subsequent levels. The parentField
attribute
identifies which field within the node templates should be used to
identify parent nodes. The splitFields and parentField should be
component fields of the treeNodeClass templates. A TreeSpec should
specify either splitFields or a parentField, not both.elem
- the element to parsepublic org.w3c.dom.Element toXml(org.w3c.dom.Document doc)
doc
- the document to use to create the elements