1 |
219
|
jones
|
/**
|
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 |
|
|
*
|
9 |
|
|
* '$Author$'
|
10 |
|
|
* '$Date$'
|
11 |
|
|
* '$Revision$'
|
12 |
669
|
jones
|
*
|
13 |
|
|
* This program is free software; you can redistribute it and/or modify
|
14 |
|
|
* it under the terms of the GNU General Public License as published by
|
15 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
16 |
|
|
* (at your option) any later version.
|
17 |
|
|
*
|
18 |
|
|
* This program is distributed in the hope that it will be useful,
|
19 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
|
|
* GNU General Public License for more details.
|
22 |
|
|
*
|
23 |
|
|
* You should have received a copy of the GNU General Public License
|
24 |
|
|
* along with this program; if not, write to the Free Software
|
25 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
26 |
219
|
jones
|
*/
|
27 |
|
|
|
28 |
|
|
package edu.ucsb.nceas.metacat;
|
29 |
|
|
|
30 |
|
|
/**
|
31 |
|
|
* A Class that represents an XML Comment node and its contents,
|
32 |
|
|
*/
|
33 |
|
|
public class CommentNode extends BasicNode {
|
34 |
|
|
|
35 |
|
|
private String nodeData = null;
|
36 |
|
|
|
37 |
|
|
/**
|
38 |
|
|
* Construct a new CommentNode instance
|
39 |
|
|
*
|
40 |
|
|
* @param nodeid the element_id for the node to be created
|
41 |
|
|
* @param parentnodeid the id of the parent node
|
42 |
|
|
* @param nodedata the text of the node
|
43 |
|
|
* @param nodetype the type of the node
|
44 |
|
|
*/
|
45 |
|
|
public CommentNode (long nodeid, long parentnodeid,
|
46 |
|
|
String nodedata) {
|
47 |
|
|
setNodeID(nodeid);
|
48 |
|
|
setParentID(parentnodeid);
|
49 |
|
|
setNodeData(nodedata);
|
50 |
|
|
setNodeType("COMMENT");
|
51 |
|
|
}
|
52 |
|
|
|
53 |
|
|
/** Set the node data to the given string */
|
54 |
|
|
public void setNodeData(String nodedata) {
|
55 |
|
|
this.nodeData = nodedata;
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
/** Get the node data as a string value */
|
59 |
|
|
public String getNodeData() {
|
60 |
|
|
return nodeData;
|
61 |
|
|
}
|
62 |
|
|
|
63 |
|
|
/**
|
64 |
|
|
* String representation of this text node
|
65 |
|
|
*/
|
66 |
|
|
public String toString () {
|
67 |
|
|
return ("<!-- " + nodeData + " -->");
|
68 |
|
|
}
|
69 |
|
|
}
|