Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *    Purpose: A Class that represents an XML Comment 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 Comment node and its contents,
19
 */
20
public class CommentNode extends BasicNode {
21

    
22
    private String      nodeData = null;
23

    
24
    /** 
25
     * Construct a new CommentNode 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
    public CommentNode (long nodeid, long parentnodeid,
33
                          String nodedata) {
34
      setNodeID(nodeid);
35
      setParentID(parentnodeid);
36
      setNodeData(nodedata);
37
      setNodeType("COMMENT");
38
    }
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

    
58
/**
59
 * '$Log$
60
 * 'Revision 1.1  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
 */
(5-5/27)