edu.ucsb.nceas.metacat
Class DBSAXNode

java.lang.Object
  |
  +--edu.ucsb.nceas.metacat.BasicNode
        |
        +--edu.ucsb.nceas.metacat.DBSAXNode

public class DBSAXNode
extends BasicNode

A Class that represents an XML node and its contents and can write its own representation to a database connection


Constructor Summary
DBSAXNode(java.sql.Connection conn, java.lang.String tagname)
          Construct a new node instance for DOCUMENT nodes
DBSAXNode(java.sql.Connection conn, java.lang.String tagname, DBSAXNode parentNode, DBSAXNode rootNode, DBSAXDocument currentDocument)
          Construct a new node instance for ELEMENT nodes
 
Method Summary
 DBSAXNode getParentNode()
          get the parent of this node
 void setAttribute(java.lang.String attName, java.lang.String attValue)
          Add a new attribute to this node, or set its value
 void writeChildNodeToDB(java.lang.String nodetype, java.lang.String nodename, java.lang.String data)
          creates SQL code and inserts new node into DB connection
 void writeDocID(java.lang.String doc_id)
          creates SQL code to put doc ID for the document node and for comment/PI nodes under document node into DB connection
 void writeNodename(java.lang.String nodename)
          creates SQL code to put nodename for the document node into DB connection
 void writeRootNodeID(long rootnode_id)
          creates SQL code to put root node id for the document node into DB connection
 
Methods inherited from class edu.ucsb.nceas.metacat.BasicNode
addChildNode, getAttribute, getAttributes, getChildren, getDocID, getNodeID, getNodeIndex, getNodeType, getParentID, getRootNodeID, getTagName, incChildNum, setDocID, setNodeID, setNodeIndex, setNodeType, setParentID, setRootNodeID, setTagName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSAXNode

public DBSAXNode(java.sql.Connection conn,
                 java.lang.String tagname)
Construct a new node instance for DOCUMENT nodes
Parameters:
conn - the JDBC Connection to which all information is written
tagname - the name of the node

DBSAXNode

public DBSAXNode(java.sql.Connection conn,
                 java.lang.String tagname,
                 DBSAXNode parentNode,
                 DBSAXNode rootNode,
                 DBSAXDocument currentDocument)
Construct a new node instance for ELEMENT nodes
Parameters:
conn - the JDBC Connection to which all information is written
tagname - the name of the node
parentNode - the parent node for this node being created
Method Detail

writeChildNodeToDB

public void writeChildNodeToDB(java.lang.String nodetype,
                               java.lang.String nodename,
                               java.lang.String data)
creates SQL code and inserts new node into DB connection

writeNodename

public void writeNodename(java.lang.String nodename)
creates SQL code to put nodename for the document node into DB connection

writeRootNodeID

public void writeRootNodeID(long rootnode_id)
creates SQL code to put root node id for the document node into DB connection

writeDocID

public void writeDocID(java.lang.String doc_id)
creates SQL code to put doc ID for the document node and for comment/PI nodes under document node into DB connection

setAttribute

public void setAttribute(java.lang.String attName,
                         java.lang.String attValue)
Add a new attribute to this node, or set its value
Overrides:
setAttribute in class BasicNode

getParentNode

public DBSAXNode getParentNode()
get the parent of this node


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