|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
XML Parser abstraction. This allows us to use any parser for which we can write an implementation of this interface that creates a DOM tree.
Note: classes implementing this interface must be reusable - i.e., they should be able to parse more than one input xml doc sequentially
| Method Summary | |
boolean |
anyErrors()
return if any errors occurred while parsing |
Vector |
getErrorMsgs()
Return any error messages generated during parsing |
String |
getErrorMsgString()
Return any error messages generated during parsing as a single string, with each message separated by a newline. |
Document |
parse(File file)
parse the passed file as an XML document |
Document |
parse(InputSource inputSource)
parse the passed SAX InputSource as an XML document |
Document |
parse(InputStream input)
parse the input stream as an XML document |
Document |
parse(Reader input)
parse the input stream as an XML document |
Document |
parse(String uri)
parse the passed uri as an XML document |
void |
reportErrorMsgs(OutputStream out)
Output any error messages from last parse operation |
void |
setContextURI(String URI)
Set the context URI for parsing. |
| Method Detail |
public Document parse(InputStream input)
input - input stream to be treated as XML document
public Document parse(Reader input)
input - reader to be treated as XML document
public Document parse(String uri)
throws FileNotFoundException,
IOException,
MalformedURLException
uri - The uri string
FileNotFoundException
IOException
MalformedURLException
public Document parse(File file)
throws FileNotFoundException
file - file
FileNotFoundException
public Document parse(InputSource inputSource)
throws FileNotFoundException,
IOException
InputSource as an XML document
inputSource - The input source from which to get the
input stream.
FileNotFoundException
IOException
public void setContextURI(String URI)
throws MalformedURLException
parse(java.io.InputStream input) and
parse(java.io.Reader input).
URI - the URI
MalformedURLException - If the passed URI is
malformed or can't be made into a URL.public boolean anyErrors()
public Vector getErrorMsgs()
public String getErrorMsgString()
public void reportErrorMsgs(OutputStream out)
out - OutputStream object to write to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||