|
XML Parser for Java 1.1.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.xml.parser.Stderr
Stderr provides the XML4J parser's default implementations of the ErrorListener and StreamProducer interfaces.
ErrorListener
,
StreamProducer
Field Summary | |
protected java.util.Hashtable |
catalog
|
protected boolean |
isPrintWarning
|
protected java.lang.String |
name
|
static java.io.PrintWriter |
printer
|
protected java.util.Stack |
stack
|
protected java.net.URL |
url
|
Constructor Summary | |
Stderr(java.lang.String name)
Constructor. |
Method Summary | |
void |
closeInputStream(Source source)
Removes the input stream currently in use. |
int |
error(java.lang.String file,
int lineNo,
int charOffset,
java.lang.Object key,
java.lang.String msg)
Listen for XML4J parser errors, and reports these errors through the standard error stream (System.err). |
static java.net.URL |
file2URL(java.lang.String file)
Returns a file-protocol URL constructed from a context of the specified file and the JVM's system property "user.dir". |
Source |
getInputStream(java.lang.String name,
java.lang.String publicID,
java.lang.String systemID)
Returns the source of the input stream (could be a character stream or a byte stream) based on this constructor's name parameter and the URL specification given by systemID and publicID. |
void |
loadCatalog(java.io.Reader reader)
Loads a catalog which provides mapping between public IDs to system IDs or URNs to URLs. |
void |
setPrintWarning(boolean isPrintWarning)
Sets whether prints warnings. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static java.io.PrintWriter printer
protected java.lang.String name
protected java.net.URL url
protected java.util.Stack stack
protected java.util.Hashtable catalog
protected boolean isPrintWarning
Constructor Detail |
public Stderr(java.lang.String name)
java.net.URL
can handles.name
- URL or filespec to use as the default input stream; if a filespec is
provided, this value can include a drive and directory spec.
This value is also used to associate a name with errors reported to the
default error listener (i.e. error()
method) that
have a file parameter =null
.error(java.lang.String, int, int, java.lang.Object, java.lang.String)
Method Detail |
public void setPrintWarning(boolean isPrintWarning)
By default, prints warnings.
isPrintWarning
- =true
means prints warnings;
=false
means prints no warnings.public static java.net.URL file2URL(java.lang.String file) throws java.net.MalformedURLException
file
- The file to use in constructing the URL; this value can include a
drive and directory spec.public int error(java.lang.String file, int lineNo, int charOffset, java.lang.Object key, java.lang.String msg)
Listen for XML4J parser errors, and reports these errors through the standard error stream (System.err).
This method is defined by ErrorListener.
file
- Processing file, or null if this constructor's
name parameter is to be used.lineNo
- The line number where the current document event ends, or
-1 if not available. Note that this is the line
position of the first character after the text associated with
the document event. Do NOT trust this value when the input
stream includes invalid octet as its encoding.charOffset
- The column number where the current document event ends, or
-1 if not available. Note that this is the column
number of the first character after the text associated with the
document event. The first column in a line is position 1. Do NOT
trust this value when the input stream includes invalid octet as its encoding.key
- The object may be an instance of String
or Exception
.
When this object is String
, this value may help
classify msg as an error (begins with "E_") or warning
(begins with "W_") or a validation error (begins with "V_").msg
- The error or warning message.ErrorListener
public Source getInputStream(java.lang.String name, java.lang.String publicID, java.lang.String systemID) throws java.io.IOException
Returns the source of the input stream (could be a character stream or a byte stream) based on this constructor's name parameter and the URL specification given by systemID and publicID.
This method is defined by StreamProducer.
name
- CURRENTLY NOT IMPLEMENTED.publicID
- Entity's public ID which is to be used in preference to systemID, or
null if no catalog is available.systemID
- Entity's URI (URL or URN).loadCatalog(java.io.Reader)
,
closeInputStream(com.ibm.xml.parser.Source)
,
ExternalID
,
StreamProducer
public void closeInputStream(Source source)
Removes the input stream currently in use.
This method is defined by StreamProducer.
source
- CURRENTLY NOT IMPLEMENTED.getInputStream(java.lang.String, java.lang.String, java.lang.String)
,
StreamProducer
public void loadCatalog(java.io.Reader reader) throws java.io.IOException
This method reads data until it reaches the end of the stream, but it does not close the stream.
public ID<TAB>URI public ID<TAB>URI URN<TAB>URL : :
Note: Public IDs can not contain #xD
or #xA
.
reader
- Character input stream reader.getInputStream(java.lang.String, java.lang.String, java.lang.String)
,
ExternalID
,
Parser.loadCatalog(java.io.Reader)
,
StreamProducer.loadCatalog(java.io.Reader)
|
XML Parser for Java 1.1.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |