|
| Path (String path) |
|
| Path (String[] nodes) |
|
Document | getDoc () |
|
void | setDoc (Document doc) |
|
Element | getNode (boolean create) throws JDOMException |
|
void | delNode (String path) throws JDOMException |
|
List< String > | getChildrenValue (String element, String name) throws JDOMException |
|
List< String[]> | getChildrenValues (String element, String names[]) throws JDOMException |
|
String | getNodeValue (String name) throws JDOMException |
|
String[] | getNodeValues (String names[]) throws JDOMException |
|
void | setChildrenValue (String element, String name, List< String > values) throws JDOMException |
|
void | setChildrenValues (String element, String names[], List< String[]> values) throws JDOMException |
|
void | setNodeValue (String name, String value) throws JDOMException |
|
void | setNodeValues (String names[], String[] values) throws JDOMException |
|
|
abstract Element | createNode (Element root, String path, int index) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 32 of file Path.java.
◆ Path() [1/2]
org.turro.configuration.Path.Path |
( |
String |
path | ) |
|
Definition at line 37 of file Path.java.
38 if(path.startsWith(
"/")) {
39 nodes = path.substring(1).split(
"/");
41 nodes = path.split(
"/");
◆ Path() [2/2]
org.turro.configuration.Path.Path |
( |
String[] |
nodes | ) |
|
◆ createNode()
abstract Element org.turro.configuration.Path.createNode |
( |
Element |
root, |
|
|
String |
path, |
|
|
int |
index |
|
) |
| |
|
abstractprotected |
◆ delNode()
void org.turro.configuration.Path.delNode |
( |
String |
path | ) |
throws JDOMException |
Definition at line 72 of file Path.java.
73 Object obj = XPath.selectSingleNode(
doc.getRootElement(), path);
74 if(obj instanceof Content) {
75 ((Content) obj).detach();
◆ getChildrenValue()
List<String> org.turro.configuration.Path.getChildrenValue |
( |
String |
element, |
|
|
String |
name |
|
) |
| throws JDOMException |
Definition at line 79 of file Path.java.
80 ArrayList<String> list =
new ArrayList<String>();
82 for(Element cel : (List<Element>) el.getChildren(element)) {
83 list.add(cel.getAttributeValue(name));
Element getNode(boolean create)
◆ getChildrenValues()
List<String[]> org.turro.configuration.Path.getChildrenValues |
( |
String |
element, |
|
|
String |
names[] |
|
) |
| throws JDOMException |
Definition at line 88 of file Path.java.
89 ArrayList<String[]> list =
new ArrayList<String[]>();
91 for(Element cel : (List<Element>) el.getChildren(element)) {
92 ArrayList<String> l =
new ArrayList<String>();
93 for(
int i = 0; i < names.length; i++) {
94 l.add(cel.getAttributeValue(names[i]));
96 list.add(l.toArray(
new String[0]));
◆ getDoc()
Document org.turro.configuration.Path.getDoc |
( |
| ) |
|
◆ getNode()
Element org.turro.configuration.Path.getNode |
( |
boolean |
create | ) |
throws JDOMException |
Definition at line 57 of file Path.java.
58 Element curr =
doc.getRootElement();
60 for(String node :
nodes) {
61 Element tmp = (Element) XPath.selectSingleNode(curr, node);
62 if(tmp ==
null && create) {
65 if(tmp ==
null)
return null;
abstract Element createNode(Element root, String path, int index)
◆ getNodeValue()
String org.turro.configuration.Path.getNodeValue |
( |
String |
name | ) |
throws JDOMException |
Definition at line 101 of file Path.java.
103 return el.getAttributeValue(name);
◆ getNodeValues()
String [] org.turro.configuration.Path.getNodeValues |
( |
String |
names[] | ) |
throws JDOMException |
Definition at line 106 of file Path.java.
108 ArrayList<String> l =
new ArrayList<String>();
109 for(
int i = 0; i < names.length; i++) {
110 l.add(el.getAttributeValue(names[i]));
112 return l.toArray(
new String[0]);
◆ setChildrenValue()
void org.turro.configuration.Path.setChildrenValue |
( |
String |
element, |
|
|
String |
name, |
|
|
List< String > |
values |
|
) |
| throws JDOMException |
Definition at line 115 of file Path.java.
118 for(String v : values) {
119 Element nel =
new Element(element);
120 nel.setAttribute(name, v);
◆ setChildrenValues()
void org.turro.configuration.Path.setChildrenValues |
( |
String |
element, |
|
|
String |
names[], |
|
|
List< String[]> |
values |
|
) |
| throws JDOMException |
Definition at line 125 of file Path.java.
128 for(String[] vs : values) {
129 Element nel =
new Element(element);
130 for(
int i = 0; i < names.length; i++) {
131 nel.setAttribute(names[i], vs[i]);
◆ setDoc()
void org.turro.configuration.Path.setDoc |
( |
Document |
doc | ) |
|
◆ setNodeValue()
void org.turro.configuration.Path.setNodeValue |
( |
String |
name, |
|
|
String |
value |
|
) |
| throws JDOMException |
Definition at line 137 of file Path.java.
139 el.setAttribute(name, value);
◆ setNodeValues()
void org.turro.configuration.Path.setNodeValues |
( |
String |
names[], |
|
|
String[] |
values |
|
) |
| throws JDOMException |
Definition at line 142 of file Path.java.
144 for(
int i = 0; i < names.length; i++) {
145 el.setAttribute(names[i], values[i]);
◆ doc
Document org.turro.configuration.Path.doc |
|
protected |
◆ nodes
String org.turro.configuration.Path.nodes[] |
|
protected |
The documentation for this class was generated from the following file: