edu.ucsb.nceas.metaedit
Interface ParserDriver

All Known Implementing Classes:
IBMParser

public interface ParserDriver

Interface defining methods needed to extract DTD information from a variety of parsers. Functionally hides the particular parser implementations from the application.

Version:
0.9Beta
Author:
Matthew Jones, Zheng Wang, Rudolf Nottrott

Method Summary
 void appendElement(org.w3c.dom.Element selectedTreeElement, org.w3c.dom.Element chosenElementToAppend)
           
 edu.ucsb.nceas.metaedit.TXElement createElement(java.lang.String nameOfChosenElementToAppend)
           
 edu.ucsb.nceas.metaedit.TXText createTextNode(java.lang.String data, boolean ignorable)
           
 java.util.Vector getAppendableElements(ElementFactory.TreeElement selectedTreeElement)
          Create a Vector of names that are appendable as children on the element specified in selectedTreeElement.
 java.util.Vector getAppendablesInProperOrder(ElementFactory.TreeElement selectedTreeElement)
           
 java.lang.String getContentModelString(ElementFactory.TreeElement treeElement)
           
 int getContentType(java.lang.String elementName)
          Determine the content type for a given element type.
 org.w3c.dom.Document getDocumentDOM()
           
 javax.swing.JTree getDocumentJTree()
           
 edu.ucsb.nceas.metaedit.DTD getDTD()
           
 java.util.Enumeration getDTDAttrDecls(ElementFactory.TreeElement selectedTreeElement)
          Determine the attributes declared in the DTD for a given node.
 java.util.Vector getInsertableBefore(ElementFactory.TreeElement selectedTreeElement)
          Creates a Vector of element names that are insertable as siblings after the element that is specified in selectedTreeElement.
 edu.ucsb.nceas.metaedit.TXAttribute[] getTagAttrDeclsArray(ElementFactory.TreeElement selectedTreeElement)
           
 void insertElement(ElementFactory.TreeElement selectedTreeElement, ElementFactory.TreeElement chosenElementToInsert)
           
 void removeElement(ElementFactory.TreeElement selectedTreeElement)
           
 org.w3c.dom.Node validateElement(ElementFactory.TreeElement treeElement)
           
 

Method Detail

getAppendableElements

public java.util.Vector getAppendableElements(ElementFactory.TreeElement selectedTreeElement)
Create a Vector of names that are appendable as children on the element specified in selectedTreeElement.
Parameters:
selectedTreeElement - the element for which allowable children are being determined
Returns:
a vector of strings with the names of allowable children nodes

getAppendablesInProperOrder

public java.util.Vector getAppendablesInProperOrder(ElementFactory.TreeElement selectedTreeElement)

getInsertableBefore

public java.util.Vector getInsertableBefore(ElementFactory.TreeElement selectedTreeElement)
Creates a Vector of element names that are insertable as siblings after the element that is specified in selectedTreeElement.
Parameters:
selectedTreeElement - the element for which allowable siblings are being determined
Returns:
a vector of strings with the names of allowable sibling elements, or null if we are at the root element

getDTDAttrDecls

public java.util.Enumeration getDTDAttrDecls(ElementFactory.TreeElement selectedTreeElement)
Determine the attributes declared in the DTD for a given node. Note that this returns a data type that is specific to the IBM parser -- a BIG PROBLEM!
Parameters:
pare - the node for which the attribute declartions apply
Returns:
a Hashtable of attribute definitions

getTagAttrDeclsArray

public edu.ucsb.nceas.metaedit.TXAttribute[] getTagAttrDeclsArray(ElementFactory.TreeElement selectedTreeElement)

getContentType

public int getContentType(java.lang.String elementName)
Determine the content type for a given element type. NEED TO FIX THIS TO USE OUR NCEASElement TYPE CONSTANTS
Parameters:
elementName - the element name to look up
Returns:
integer indicating the content type

getDocumentJTree

public javax.swing.JTree getDocumentJTree()

getDTD

public edu.ucsb.nceas.metaedit.DTD getDTD()

getDocumentDOM

public org.w3c.dom.Document getDocumentDOM()

createElement

public edu.ucsb.nceas.metaedit.TXElement createElement(java.lang.String nameOfChosenElementToAppend)

createTextNode

public edu.ucsb.nceas.metaedit.TXText createTextNode(java.lang.String data,
                                                     boolean ignorable)

appendElement

public void appendElement(org.w3c.dom.Element selectedTreeElement,
                          org.w3c.dom.Element chosenElementToAppend)

insertElement

public void insertElement(ElementFactory.TreeElement selectedTreeElement,
                          ElementFactory.TreeElement chosenElementToInsert)

removeElement

public void removeElement(ElementFactory.TreeElement selectedTreeElement)

validateElement

public org.w3c.dom.Node validateElement(ElementFactory.TreeElement treeElement)

getContentModelString

public java.lang.String getContentModelString(ElementFactory.TreeElement treeElement)


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.