1 |
128
|
jones
|
/**
|
2 |
168
|
jones
|
* Name: TextNode.java
|
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 |
128
|
jones
|
*
|
9 |
168
|
jones
|
* Version: '$Id$'
|
10 |
128
|
jones
|
*/
|
11 |
|
|
|
12 |
|
|
package edu.ucsb.nceas.metacat;
|
13 |
|
|
|
14 |
|
|
/**
|
15 |
140
|
jones
|
* A Class that represents an XML Text node and its contents,
|
16 |
128
|
jones
|
*/
|
17 |
129
|
jones
|
public class TextNode extends BasicNode {
|
18 |
128
|
jones
|
|
19 |
|
|
private String nodeData = null;
|
20 |
|
|
|
21 |
|
|
/**
|
22 |
|
|
* Construct a new TextNode instance
|
23 |
|
|
*
|
24 |
|
|
* @param nodeid the element_id for the node to be created
|
25 |
|
|
* @param parentnodeid the id of the parent node
|
26 |
|
|
* @param nodedata the text of the node
|
27 |
|
|
* @param nodetype the type of the node
|
28 |
|
|
*/
|
29 |
157
|
jones
|
public TextNode (long nodeid, long parentnodeid,
|
30 |
128
|
jones
|
String nodedata, String nodetype) {
|
31 |
134
|
jones
|
setNodeID(nodeid);
|
32 |
128
|
jones
|
setParentID(parentnodeid);
|
33 |
|
|
setNodeData(nodedata);
|
34 |
|
|
setNodeType(nodetype);
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
/** Set the node data to the given string */
|
38 |
|
|
public void setNodeData(String nodedata) {
|
39 |
|
|
this.nodeData = nodedata;
|
40 |
|
|
}
|
41 |
|
|
|
42 |
|
|
/** Get the node data as a string value */
|
43 |
|
|
public String getNodeData() {
|
44 |
|
|
return nodeData;
|
45 |
|
|
}
|
46 |
|
|
|
47 |
|
|
/**
|
48 |
|
|
* String representation of this text node
|
49 |
|
|
*/
|
50 |
|
|
public String toString () {
|
51 |
|
|
return nodeData;
|
52 |
|
|
}
|
53 |
|
|
}
|