|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.common.xml.XmlUtil
public final class XmlUtil
Utility class for simplifying parsing of xml documents. Documents are not validated, and loading of external files (xinclude, external entities, DTDs, etc.) are disabled.
| Method Summary | |
|---|---|
static String |
getAttribute(Node node,
String attr)
|
static String |
getAttribute(Node node,
String attr,
String def)
Extracts an attribute from a node. |
static boolean |
getBoolAttribute(Node node,
String attr)
|
static boolean |
getBoolAttribute(Node node,
String attr,
boolean def)
Retrieves an attribute as a boolean. |
static Uri |
getHttpUriAttribute(Node node,
String attr,
Uri base)
Retrieves an attribute as a URI, and verifies that the URI is an http or https URI. |
static Uri |
getHttpUriAttribute(Node node,
String attr,
Uri base,
Uri def)
Retrieves an attribute as a URI, and verifies that the URI is an http or https URI. |
static int |
getIntAttribute(Node node,
String attr)
|
static int |
getIntAttribute(Node node,
String attr,
int def)
|
static Uri |
getUriAttribute(Node node,
String attr)
Retrieves an attribute as a URI. |
static Uri |
getUriAttribute(Node node,
String attr,
Uri def)
Retrieves an attribute as a URI. |
static Element |
parse(String xml)
Attempts to parse the input xml into a single element. |
static Element |
parseSilent(String xml)
Same as parse(String), but throws a RuntimeException instead of XmlException. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String getAttribute(Node node,
String attr,
String def)
node - attr - def -
public static String getAttribute(Node node,
String attr)
node - attr -
public static Uri getUriAttribute(Node node,
String attr,
Uri def)
node - attr -
public static Uri getUriAttribute(Node node,
String attr)
node - attr -
public static Uri getHttpUriAttribute(Node node,
String attr,
Uri base,
Uri def)
node - attr - base - def - @return the parsed uri, or def if the attribute is not a valid http or
https URI.
public static Uri getHttpUriAttribute(Node node,
String attr,
Uri base)
node - attr - base -
public static boolean getBoolAttribute(Node node,
String attr,
boolean def)
node - attr - def -
public static boolean getBoolAttribute(Node node,
String attr)
node - attr -
public static int getIntAttribute(Node node,
String attr,
int def)
public static int getIntAttribute(Node node,
String attr)
public static Element parse(String xml)
throws XmlException
xml -
XmlException - if a parse error occured.public static Element parseSilent(String xml)
parse(String), but throws a RuntimeException instead of XmlException.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||