Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *    Purpose: A Class that represents an XML PI node and its contents,
4
 *             and can build itself from a database connection
5
 *  Copyright: 2000 Regents of the University of California and the
6
 *             National Center for Ecological Analysis and Synthesis
7
 *    Authors: Matt Jones
8
 *    Release: @release@
9
 *
10
 *   '$Author: jones $'
11
 *     '$Date: 2000-08-14 13:53:34 -0700 (Mon, 14 Aug 2000) $'
12
 * '$Revision: 349 $'
13
 */
14

    
15
package edu.ucsb.nceas.metacat;
16

    
17
/**
18
 * A Class that represents an XML PI node and its contents,
19
 */
20
public class PINode extends BasicNode {
21

    
22
    private String      nodeData = null;
23

    
24
    /** 
25
     * Construct a new PINode instance
26
     *
27
     * @param nodeid the id for the node to be created
28
     * @param parentnodeid the id of the parent node
29
     * @param nodename the name of the PI node
30
     * @param nodedata the contents of the PI node
31
     */
32
    public PINode (long nodeid, long parentnodeid, String nodename,
33
                          String nodedata) {
34
      setNodeID(nodeid);
35
      setParentID(parentnodeid);
36
      setTagName(nodename);
37
      setNodeData(nodedata);
38
      setNodeType("PI");
39
    }
40

    
41
    /** Set the node data to the given string */
42
    public void setNodeData(String nodedata) {
43
      this.nodeData = nodedata;
44
    }
45

    
46
    /** Get the node data as a string value */
47
    public String getNodeData() {
48
      return nodeData;
49
    }
50

    
51
    /** 
52
     * String representation of this text node
53
     */
54
    public String toString () {
55
        return ("<?" + getTagName() + " " + nodeData + " ?>");
56
    }
57
}
58

    
59
/**
60
 * '$Log$
61
 * 'Revision 1.1  2000/06/28 02:36:26  jones
62
 * 'Added feature to now ouput COMMENTs and PIs when the document is
63
 * 'read from the database with DBReader.
64
 * '
65
 */
(24-24/27)