|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XMLParser
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 |
---|
Document parse(InputStream input)
input
- input stream to be treated as XML document
Document parse(Reader input)
input
- reader to be treated as XML document
Document parse(String uri) throws FileNotFoundException, IOException, MalformedURLException
uri
- The uri string
FileNotFoundException
IOException
MalformedURLException
Document parse(File file) throws FileNotFoundException
file
- file
FileNotFoundException
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
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.boolean anyErrors()
Vector getErrorMsgs()
String getErrorMsgString()
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 |