|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.emulator.creator.util.Xml
public class Xml
Constructor Summary | |
---|---|
private |
Xml()
|
Method Summary | |
---|---|
static Element |
createSimpleTag(Document doc,
String name,
String content)
Create a tag called "name" which contains a text element "content." For example: <name>content</name> |
static Element |
getSimpleEl(Element parent,
String tag)
Get an element within a parent. |
static List<Element> |
getSimpleEls(Element parent,
String tag)
Get a list of children of the parent that have a given tag name. |
static Element |
getSimpleElWithDefault(Element parent,
String tag,
Element def)
Get an element within a parent. |
static String |
getSimpleTag(Element parent,
String tag)
Get the content of a tag contained with a parent. |
static String |
getSimpleTagWithDefault(Element parent,
String tag,
String def)
Get the string contained within a tag of the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private Xml()
Method Detail |
---|
public static Element createSimpleTag(Document doc, String name, String content)
doc
- The XML document to use to create the tag.name
- The name of the wrapping tag.content
- The content to be placed into the tag.
public static Element getSimpleEl(Element parent, String tag) throws ConfigException
parent
- The XML element holding the tag we are searching for.tag
- The tag we are searching for.
ConfigException
public static Element getSimpleElWithDefault(Element parent, String tag, Element def)
parent
- The parent of the XML element we are searching for.tag
- The name of the tag we are searching for.def
- The value to return if the element could not be found.
public static List<Element> getSimpleEls(Element parent, String tag)
parent
- The parent of the elements to search for.tag
- The tag of the elements to find.
public static String getSimpleTag(Element parent, String tag) throws ConfigException
parent
- The parent node, which contains the node we are searching
for.tag
- The tag we want the content of.
ConfigException
public static String getSimpleTagWithDefault(Element parent, String tag, String def)
parent
- The parent of the tag to find.tag
- The name of the tag to find.def
- The default value to return if the given tag is not found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |