|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.utilities.xml.dom.XMLDataReader
This class uses the Micorsoft-DataChannel's XML parser to read data from an XML file and constructs the XMLNode tree.
It loads the XML file using the specified URL and constructs the XMLNode tree by creating an XMLNode object for each Element/Comment/PCDATA/CDATA/Entity object in the XML file. Using the parentNode and childNodeList references in the XMLNode object, the elements are linked together to form the tree.
To facilitate quick search for a particular element, and to uniquely identify each element it relies on each element having an ID attribute with a unique value.
com.adventnet.utils.xml.XMLNode, Serialized Form| Field Summary | |
static int |
APPLICATION
|
(package private) boolean |
doValidate
|
static int |
EJB_APPLICATION
|
| Constructor Summary | |
XMLDataReader()
When invoking this constructor, the user will need to follow it up by explicitly calling the load(String) method. |
|
XMLDataReader(java.io.InputStream istream)
This constructor will load the specified XML from the InputStream and constructs the XMLNode tree. |
|
XMLDataReader(java.io.InputStream inputStream,
int applicationType)
The XMLDataReader which reads from the given InputStream. |
|
XMLDataReader(java.io.InputStream istream,
java.lang.String ClassNameForXMLNode)
This Constructor will load the specified XML from the InputStream and and constructs the XMLNode tree. |
|
XMLDataReader(java.lang.String urlString)
This constructor will load the specified XML file and constructs the XMLNode tree. |
|
XMLDataReader(java.lang.String fileName,
boolean isUrl)
This constructor will load the specified XML file and constructs the XMLNode tree. |
|
XMLDataReader(java.lang.String fileName,
boolean isUrl,
boolean doValidate)
This constructor will load the specified XML file and constructs the XMLNode tree. |
|
XMLDataReader(java.lang.String fileName,
boolean isUrl,
boolean doValidate,
org.xml.sax.ErrorHandler errHandler)
This constructor will load the specified XML file and constructs the XMLNode tree. |
|
XMLDataReader(java.lang.String urlString,
java.lang.String ClassNameForXMLNode)
This Constructor will load the specified XML file and constructs the XMLNode tree. |
|
| Method Summary | |
java.util.Vector |
getRootChildNodes()
Returns the vector of XMLNodes under the root node |
XMLNode |
getRootNode()
This will retrieve the root element in the XML file |
void |
load(java.io.InputStream istream)
Loads the specified XML from the specified InputStream and builds the XMLNode tree. |
void |
load(java.io.InputStream inputStream,
int applicationType)
Loads the specified XML from the specified InputStream and builds the XMLNode tree. |
void |
load(java.lang.String urlString)
Loads the specified XML file and builds the XMLNode tree. |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int EJB_APPLICATION
public static final int APPLICATION
boolean doValidate
| Constructor Detail |
public XMLDataReader(java.io.InputStream inputStream,
int applicationType)
inputStream - The input Stream from which the data has to be parsed.applicationType - Specifies that the loaded xml file is from ordinary of
EJB Application Typepublic XMLDataReader(java.lang.String urlString)
urlString - (absolute/relative) path to the XML file
public XMLDataReader(java.lang.String urlString,
java.lang.String ClassNameForXMLNode)
urlString - (absolute/relative) path to the XML file.ClassNameForXMLNode - THe class name specified for the Xml node.
public XMLDataReader(java.lang.String fileName,
boolean isUrl)
throws java.lang.Exception
urlString - (absolute/relative) path to the XML file.isUrl - is a URL or a filename.
public XMLDataReader(java.lang.String fileName,
boolean isUrl,
boolean doValidate)
throws java.lang.Exception
urlString - (absolute/relative) path to the XML file.isUrl - is a URL or a filename.doValidate - to specify to validate the XML file with the
specified DTD file declared in the DOCTYPE.
By default doValidate is false.
public XMLDataReader(java.lang.String fileName,
boolean isUrl,
boolean doValidate,
org.xml.sax.ErrorHandler errHandler)
throws java.lang.Exception
urlString - (absolute/relative) path to the XML file.isUrl - is a URL or a filename.doValidate - to specify to validate the XML file with the
specified DTD file declared in the DOCTYPE.
By default doValidate is false.errHandler - to specify the ErrorHandler that will handle errors
that occur while parsing the XML file.
public XMLDataReader(java.io.InputStream istream)
throws java.lang.Exception
istream - InputStream of the XML file.
public XMLDataReader(java.io.InputStream istream,
java.lang.String ClassNameForXMLNode)
istring - InputStream of XML file.ClassNameForXMLNode - The Class name for the XML node.public XMLDataReader()
load(String urlString),
load(InputStream istream)| Method Detail |
public void load(java.lang.String urlString)
urlString - (absolute/relative)path to the XML file
public void load(java.io.InputStream istream)
throws java.lang.Exception
urlString - (absolute/relative)path to the XML filepublic XMLNode getRootNode()
public java.util.Vector getRootChildNodes()
public void load(java.io.InputStream inputStream,
int applicationType)
throws java.lang.Exception
inputStream - (absolute/relative)path to the XML file
public static void main(java.lang.String[] args)
throws java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||