|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.dpml.util.ElementHelper
public final class ElementHelper
Utility class supporting the translation of DOM content into local child, children, attribute and value values.
| Method Summary | |
|---|---|
static String |
getAttribute(Element node,
String key)
Return the value of an element attribute. |
static String |
getAttribute(Element node,
String key,
String def)
Return the value of an element attribute. |
static boolean |
getBooleanAttribute(Element node,
String key)
Return the value of an element attribute as a boolean |
static boolean |
getBooleanAttribute(Element node,
String key,
boolean def)
Return the value of an element attribute as a boolean. |
static Element |
getChild(Element root,
String name)
Return a named child relative to a supplied element. |
static Element[] |
getChildren(Element root)
Return all children of the supplied parent. |
static Element[] |
getChildren(Element root,
String name)
Return all children matching the supplied element name. |
static Element |
getRootElement(DocumentBuilder builder,
InputStream input)
Return the root element of the supplied input stream. |
static Element |
getRootElement(File definition)
Return the root element of the supplied file. |
static Element |
getRootElement(InputStream input)
Return the root element of the supplied input stream. |
static String |
getValue(Element node)
Return the value of an element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Element getRootElement(File definition)
throws Exception
definition - the file to load
Exception - if the error occurs during root element establishment
public static Element getRootElement(InputStream input)
throws Exception
input - the input stream containing a XML definition
Exception - if an error occurs
public static Element getRootElement(DocumentBuilder builder,
InputStream input)
throws Exception
builder - the document builderinput - the input stream containing a XML definition
Exception - if an error occurs
public static Element getChild(Element root,
String name)
root - the parent DOM elementname - the name of a child element
public static Element[] getChildren(Element root,
String name)
root - the parent DOM elementname - the name against which child element will be matched
public static Element[] getChildren(Element root)
root - the parent DOM element
public static String getValue(Element node)
node - the DOM node
public static String getAttribute(Element node,
String key)
node - the DOM nodekey - the attribute key
public static String getAttribute(Element node,
String key,
String def)
node - the DOM nodekey - the attribute keydef - the default value if the attribute is undefined
public static boolean getBooleanAttribute(Element node,
String key)
node - the DOM nodekey - the attribute key
public static boolean getBooleanAttribute(Element node,
String key,
boolean def)
node - the DOM nodekey - the attribute keydef - the default value if the attribute is undefined
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||