org.objectweb.easybeans.persistence.xml
Class JPersistenceUnitInfoLoader.XMLUtils

java.lang.Object
  extended by org.objectweb.easybeans.persistence.xml.JPersistenceUnitInfoLoader.XMLUtils
Enclosing class:
JPersistenceUnitInfoLoader

public static final class JPersistenceUnitInfoLoader.XMLUtils
extends java.lang.Object

Class with some useful methods on XML document.


Field Summary
private static java.lang.String PERSISTENCE_NS
          Persistence namespace.
private static java.lang.String PERSISTENCE_UNIT
          <persistence-unit> element.
 
Constructor Summary
private JPersistenceUnitInfoLoader.XMLUtils()
          Utility class, no constructor.
 
Method Summary
static java.lang.String getAttributeValue(org.w3c.dom.Element base, java.lang.String name)
          Returns the value of the attribute of the given element.
static org.w3c.dom.NodeList getPersistenceUnitElement(org.w3c.dom.Element root)
          Returns all the persistence-unit XML elements.
static java.util.Properties getPropertiesValueElement(org.w3c.dom.Element base, java.lang.String name)
          Returns a Properties object matching the given node.
static java.util.List<java.lang.String> getStringListValueElement(org.w3c.dom.Element base, java.lang.String name)
          Returns a list of value for the given node.
static java.lang.String getStringValueElement(org.w3c.dom.Element base, java.lang.String name)
          Returns the value of the given node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERSISTENCE_NS

private static final java.lang.String PERSISTENCE_NS
Persistence namespace.

See Also:
Constant Field Values

PERSISTENCE_UNIT

private static final java.lang.String PERSISTENCE_UNIT
<persistence-unit> element.

See Also:
Constant Field Values
Constructor Detail

JPersistenceUnitInfoLoader.XMLUtils

private JPersistenceUnitInfoLoader.XMLUtils()
Utility class, no constructor.

Method Detail

getPersistenceUnitElement

public static org.w3c.dom.NodeList getPersistenceUnitElement(org.w3c.dom.Element root)
Returns all the persistence-unit XML elements.

Parameters:
root - root Element.
Returns:
the matching persistence-unit XML Element.

getAttributeValue

public static java.lang.String getAttributeValue(org.w3c.dom.Element base,
                                                 java.lang.String name)
Returns the value of the attribute of the given element.

Parameters:
base - the element from where to search.
name - of the attribute to get.
Returns:
the value of this element.

getStringValueElement

public static java.lang.String getStringValueElement(org.w3c.dom.Element base,
                                                     java.lang.String name)
Returns the value of the given node.

Parameters:
base - the element from where to search.
name - of the element to get.
Returns:
the value of this element.

getPropertiesValueElement

public static java.util.Properties getPropertiesValueElement(org.w3c.dom.Element base,
                                                             java.lang.String name)
Returns a Properties object matching the given node.

Parameters:
base - the element from where to search.
name - of the element to get.
Returns:
the value of this element.

getStringListValueElement

public static java.util.List<java.lang.String> getStringListValueElement(org.w3c.dom.Element base,
                                                                         java.lang.String name)
Returns a list of value for the given node.

Parameters:
base - the element from where to search.
name - of the element to get.
Returns:
the list of value of this element.