com.indexdata.torus2.util
Class DOMHelper

java.lang.Object
  extended by com.indexdata.torus2.util.DOMHelper

public class DOMHelper
extends Object

Helper class for common (awkward) DOM operations on the record object. May disappear if the records get an objectified wrapper.

Author:
jakub

Constructor Summary
DOMHelper()
           
 
Method Summary
static Element createChild(Element parent, String name)
          The method creates and appends Element node to the given parent.
static List<Element> getChildrenByName(Element base, String name)
           
static Element getFirstChildByName(Element base, String name)
           
static String getFirstChildText(Element base, String name)
           
static String getFirstElementText(Element base, String elemName)
           
static Element getFirstElemWithAttr(Element base, String elemName, String attrName, String attrVal)
           
static void setUniqueChild(Element base, String name, String value)
          Set child text node within the base level, ensure there's no duplicates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMHelper

public DOMHelper()
Method Detail

createChild

public static Element createChild(Element parent,
                                  String name)
The method creates and appends Element node to the given parent. If parent is null, a new document is created.

Parameters:
parent -
name -

getFirstChildByName

public static Element getFirstChildByName(Element base,
                                          String name)

getFirstChildText

public static String getFirstChildText(Element base,
                                       String name)

getChildrenByName

public static List<Element> getChildrenByName(Element base,
                                              String name)

setUniqueChild

public static void setUniqueChild(Element base,
                                  String name,
                                  String value)
Set child text node within the base level, ensure there's no duplicates

Parameters:
base -

getFirstElemWithAttr

public static Element getFirstElemWithAttr(Element base,
                                           String elemName,
                                           String attrName,
                                           String attrVal)

getFirstElementText

public static String getFirstElementText(Element base,
                                         String elemName)


Copyright © 2008-2013 Index Data. All Rights Reserved.