Project

General

Profile

1 128 jones
/**
2 203 jones
 *  '$RCSfile$'
3
 *    Purpose: A Class that represents an XML Text 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 349 jones
 *    Release: @release@
9 128 jones
 *
10 203 jones
 *   '$Author$'
11
 *     '$Date$'
12
 * '$Revision$'
13 128 jones
 */
14
15
package edu.ucsb.nceas.metacat;
16
17
/**
18 140 jones
 * A Class that represents an XML Text node and its contents,
19 128 jones
 */
20 129 jones
public class TextNode extends BasicNode {
21 128 jones
22
    private String      nodeData = null;
23
24
    /**
25
     * Construct a new TextNode instance
26
     *
27
     * @param nodeid the element_id for the node to be created
28
     * @param parentnodeid the id of the parent node
29
     * @param nodedata the text of the node
30
     * @param nodetype the type of the node
31
     */
32 157 jones
    public TextNode (long nodeid, long parentnodeid,
33 219 jones
                          String nodedata) {
34 134 jones
      setNodeID(nodeid);
35 128 jones
      setParentID(parentnodeid);
36
      setNodeData(nodedata);
37 219 jones
      setNodeType("TEXT");
38 128 jones
    }
39
40
    /** Set the node data to the given string */
41
    public void setNodeData(String nodedata) {
42
      this.nodeData = nodedata;
43
    }
44
45
    /** Get the node data as a string value */
46
    public String getNodeData() {
47
      return nodeData;
48
    }
49
50
    /**
51
     * String representation of this text node
52
     */
53
    public String toString () {
54
        return nodeData;
55
    }
56
}
57 203 jones
58
/**
59
 * '$Log$
60 349 jones
 * 'Revision 1.8  2000/06/28 02:36:26  jones
61
 * 'Added feature to now ouput COMMENTs and PIs when the document is
62
 * 'read from the database with DBReader.
63
 * '
64 219 jones
 * 'Revision 1.7  2000/06/26 10:35:05  jones
65
 * 'Merged in substantial changes to DBWriter and associated classes and to
66
 * 'the MetaCatServlet in order to accomodate the new UPDATE and DELETE
67
 * 'functions.  The command line tools and the parameters for the
68
 * 'servlet have changed substantially.
69
 * '
70 203 jones
 * 'Revision 1.6.2.2  2000/06/25 23:38:17  jones
71
 * 'Added RCSfile keyword
72
 * '
73
 * 'Revision 1.6.2.1  2000/06/25 23:34:18  jones
74
 * 'Changed documentation formatting, added log entries at bottom of source files
75
 * ''
76
 */