|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.brickred.socialauth.util.XMLParseUtil
public class XMLParseUtil
This is a utility class, which is used to read the xml files.
| Constructor Summary | |
|---|---|
XMLParseUtil()
|
|
| Method Summary | |
|---|---|
static DocumentBuilder |
getDocumentBuilder()
Returns a DocumentBuilder, which is used for parsing XML
documents. |
static String |
getElementData(Element root,
String elementName)
Gets the text value of the specified element. |
static String |
getElementData(Node node)
Static helper function to get the element data of the specified node. |
static Element |
loadXmlResource(InputStream in)
Loads the imput stream and returns the root element. |
static Element |
loadXmlResource(String fileName)
Loads the xml file into an xml document and returns the root element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLParseUtil()
| Method Detail |
|---|
public static String getElementData(Node node)
node - the node where the text data resides; may be null
in which case this funtion will return ""
null
public static String getElementData(Element root,
String elementName)
root - the root of the element whose text is to be retrieved; assumed
not to be null.elementName - the name of the element whose text is to be retrieved.
public static Element loadXmlResource(String fileName)
throws Exception
fileName - the fully qualified name of the XML file to load; assumed not
to be null.
null.
Exception - on any error
public static Element loadXmlResource(InputStream in)
throws Exception
in - Input Stream.
null.
Exception - on any errorpublic static DocumentBuilder getDocumentBuilder()
DocumentBuilder, which is used for parsing XML
documents.
DocumentBuilder which is used for parsing XML
documents. Never null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||