|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.emulator.util.XMLUtil
public final class XMLUtil
XML utlitiy routines.
Field Summary | |
---|---|
(package private) static DocumentBuilderFactory |
docBuilderFactory
|
Constructor Summary | |
---|---|
XMLUtil()
|
Method Summary | |
---|---|
static boolean |
childExists(Element element,
String tagName)
|
static Element |
convertToDom(byte[] msg,
String rootElementName)
|
static Element |
convertToDom(InputStream inStream,
String rootElementName)
|
static Element |
getChildByTagName(Document queryElement,
String tagName)
Return a single child by a given tag name. |
static Element |
getChildByTagName(Element element,
String tagName)
Return a single child by a given tag name. |
static Element |
getChildByTagName(Element element,
String tagName,
boolean required)
Return a single child by a given tag name. |
static ArrayList |
getChildrenByTagName(Document doc,
String tagName)
Return children that are Elements. |
static ArrayList |
getChildrenByTagName(Element element,
String tagName)
Return all children matching a given tag name. |
static Element |
getChoice(Element element,
String[] choices)
note getChoice doesn't handle the case where both an completely bogus entry and a valid choice are selected it simply picks the valid choice |
static Element |
getElementChild(Element element,
int index)
Return nth child that is an Element. |
static ArrayList |
getElementChildren(Document doc)
Return children that are Elements. |
static ArrayList |
getElementChildren(Element element)
Return children that are Elements. |
static Element |
getFirstElementChild(Document doc)
Return first children that is an Element. |
static Element |
getFirstElementChild(Element element)
Return first children that is an Element. |
static String |
getSingleTextContent(Element element)
Return a single text child of an Element. |
static String |
getSingleTextContent(Element element,
boolean requireContent)
|
static boolean |
parseBoolean(Element element)
|
static boolean |
parseBooleanChild(Element element,
String childName)
|
static double |
parseDouble(Element element)
|
static double |
parseDoubleChild(Element element,
String childName)
|
static double |
parseDoubleChild(Element element,
String childName,
boolean required)
|
static int |
parseInt(Element element)
|
static int |
parseIntChild(Element element,
String childName)
|
static long |
parseLong(Element element)
|
static long |
parseLongChild(Element element,
String childName)
|
static String |
parseString(Element element)
|
static String |
parseStringChild(Element element,
String childName)
|
static String |
parseStringChild(Element element,
String childName,
boolean required)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static DocumentBuilderFactory docBuilderFactory
Constructor Detail |
---|
public XMLUtil()
Method Detail |
---|
public static final ArrayList getElementChildren(Element element)
element
- Element to find child Elements forpublic static final ArrayList getElementChildren(Document doc)
doc
- Document to find child Elements forpublic static final ArrayList getChildrenByTagName(Document doc, String tagName)
doc
- Document to find child Elements forpublic static final Element getFirstElementChild(Element element) throws DeserializationException
element
- element to find child Element for
DeserializationException
public static final Element getFirstElementChild(Document doc) throws DeserializationException
doc
- Document to find child Element for
DeserializationException
public static final Element getElementChild(Element element, int index) throws DeserializationException
element
- element to find child Element for
DeserializationException
public static final String getSingleTextContent(Element element) throws DeserializationException
element
- to return text for.
DeserializationException
public static final String getSingleTextContent(Element element, boolean requireContent) throws DeserializationException
DeserializationException
public static final boolean childExists(Element element, String tagName) throws DeserializationException
DeserializationException
public static final Element getChildByTagName(Element element, String tagName) throws DeserializationException
element
- Element to find child oftagName
- tag name to match
DeserializationException
public static final Element getChildByTagName(Element element, String tagName, boolean required) throws DeserializationException
element
- Element to find child oftagName
- tag name to match
DeserializationException
public static final ArrayList getChildrenByTagName(Element element, String tagName) throws DeserializationException
element
- Element to find child oftagName
- tag name to match
DeserializationException
public static final Element getChildByTagName(Document queryElement, String tagName) throws DeserializationException
doc
- Document to find child oftagName
- tag name to match
DeserializationException
public static final Element getChoice(Element element, String[] choices) throws DeserializationException
DeserializationException
public static final String parseString(Element element) throws DeserializationException
DeserializationException
public static final long parseLong(Element element) throws DeserializationException
DeserializationException
public static final int parseInt(Element element) throws DeserializationException
DeserializationException
public static final double parseDouble(Element element) throws DeserializationException
DeserializationException
public static final boolean parseBoolean(Element element) throws DeserializationException
DeserializationException
public static final String parseStringChild(Element element, String childName) throws DeserializationException
DeserializationException
public static final String parseStringChild(Element element, String childName, boolean required) throws DeserializationException
DeserializationException
public static final long parseLongChild(Element element, String childName) throws DeserializationException
DeserializationException
public static final int parseIntChild(Element element, String childName) throws DeserializationException
DeserializationException
public static final boolean parseBooleanChild(Element element, String childName) throws DeserializationException
DeserializationException
public static final double parseDoubleChild(Element element, String childName) throws DeserializationException
DeserializationException
public static final double parseDoubleChild(Element element, String childName, boolean required) throws DeserializationException
DeserializationException
public static Element convertToDom(byte[] msg, String rootElementName) throws DeserializationException
DeserializationException
public static Element convertToDom(InputStream inStream, String rootElementName) throws DeserializationException
DeserializationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |