cz.cuni.jagrlib.xml
Class XMLAction

java.lang.Object
  extended by cz.cuni.jagrlib.xml.XMLAction

public class XMLAction
extends Object

Support class for XML output.

Since:
0.23
Version:
0.25 $Rev: 381 $ $Date: 2007-01-02 15:51:44 +0100 (Ășt, 02 I 2007) $ $Author: pepca $
Author:
Jan Kostlivy, PE
See Also:
XMLAction.java

Field Summary
static String DELIMITER0
           
static String DELIMITER1
           
static String DELIMITER2
           
static String DELIMITER3
           
static String DELIMITER4
           
static String DELIMITER5
           
static String DELIMITER6
           
 
Constructor Summary
XMLAction()
           
 
Method Summary
static Node appendChild(Document doc, Node nodeTo, String delimiter, String nodeName)
          Appends child to node.
static Node appendChild(Document doc, Node nodeTo, String delimiter, String nodeName, String nodeValue)
          Appends child to node.
static boolean getBoolLegacy(Node _node, String _name)
          Returns value of node from branch as boolean.
static Node getFirstChildElement(Node _parent)
          Returns first child Element.
static boolean getFlag(Node _node, String _name)
          Returns boolean flag (presence of the given tag, the shortest variant is name).
static Integer getIntegerValue(Node _node, String _name)
          Returns value of node from branch as Integer.
static int getIntValue(Node _node, String _name)
          Returns value of node from branch as integer.
static Node getNextSiblingElement(Node _node)
          Returns next sibling Element.
static Node getNode(Node _node, String _name)
          Returns node from branch.
static String getValue(Node _node, String _name)
          Returns value of node from branch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER0

public static final String DELIMITER0
See Also:
Constant Field Values

DELIMITER1

public static final String DELIMITER1
See Also:
Constant Field Values

DELIMITER2

public static final String DELIMITER2
See Also:
Constant Field Values

DELIMITER3

public static final String DELIMITER3
See Also:
Constant Field Values

DELIMITER4

public static final String DELIMITER4
See Also:
Constant Field Values

DELIMITER5

public static final String DELIMITER5
See Also:
Constant Field Values

DELIMITER6

public static final String DELIMITER6
See Also:
Constant Field Values
Constructor Detail

XMLAction

public XMLAction()
Method Detail

getFirstChildElement

public static Node getFirstChildElement(Node _parent)
Returns first child Element.

Parameters:
_parent - branch of data.

getNextSiblingElement

public static Node getNextSiblingElement(Node _node)
Returns next sibling Element.

Parameters:
_node - branch of data.

getValue

public static String getValue(Node _node,
                              String _name)
Returns value of node from branch.

Parameters:
_node - branch of data.
_name - name of node.

getFlag

public static boolean getFlag(Node _node,
                              String _name)
Returns boolean flag (presence of the given tag, the shortest variant is name).

Parameters:
_node - Data node.
_name - Tag name to be looked for.
Returns:
true if the given tag was found.

getBoolLegacy

public static boolean getBoolLegacy(Node _node,
                                    String _name)
Returns value of node from branch as boolean. Will be replaced by getFlag(org.w3c.dom.Node, java.lang.String) code after a while..

Parameters:
_node - branch of data.
_name - name of node.

getIntValue

public static int getIntValue(Node _node,
                              String _name)
Returns value of node from branch as integer.

Parameters:
_node - branch of data.
_name - name of node.

getIntegerValue

public static Integer getIntegerValue(Node _node,
                                      String _name)
Returns value of node from branch as Integer.

Parameters:
_node - branch of data.
_name - name of node.

getNode

public static Node getNode(Node _node,
                           String _name)
Returns node from branch.

Parameters:
_node - branch of data.
_name - name of node.

appendChild

public static Node appendChild(Document doc,
                               Node nodeTo,
                               String delimiter,
                               String nodeName,
                               String nodeValue)
Appends child to node.

Parameters:
doc - Document.
nodeTo - branch for new node.
delimiter - For formating XML document - Human readable.

appendChild

public static Node appendChild(Document doc,
                               Node nodeTo,
                               String delimiter,
                               String nodeName)
Appends child to node.

Parameters:
doc - Document.
nodeTo - branch for new node.
delimiter - For formating XML document - Human readable.