Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java
PREV | NEXT | SHOW LISTS | HIDE LISTS |

# Class com.ibm.xml.parser.Stderr

    java.lang.Object
        |
        +----com.ibm.xml.parser.Stderr

public class Stderr
extends java.lang.Object
implements ErrorListener, StreamProducer

Stderr provides the XML4J parser's default implementations of the ErrorListener and StreamProducer interfaces.

Version:
  1.1
See Also:
  ErrorListener, StreamProducer

Field Summary
static java.io.PrintWriter | printer

Constructor Summary
Stderr(java.lang.String name) Constructor.

Method Summary
void | closeInputStream(Source source) Removes the input stream currently in use.
void | 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.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

### printer

    public static java.io.PrintWriter printer

Constructor Detail

### Stderr

    public Stderr(java.lang.String name)

  Constructor.
  Parameters:
    `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`.
  See Also:
    error

Method Detail

### file2URL

    public static java.net.URL file2URL(java.lang.String file) throws java.net.MalformedURLException

  Returns a file-protocol URL constructed from a context of the specified file and the JVM's system property "user.dir".
  Parameters:
    `file` - The file to use in constructing the URL; this value can include a drive and directory spec.
  Throws:
    java.net.MalformedURLException - Thrown if unable to construct a URL based on the specified file.

### error

    public void 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.

  Implements:
    error in interface ErrorListener
  Parameters:
    `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_").
    `msg` - The error or warning message.
  See Also:
    ErrorListener

### getInputStream

    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.

  This method is defined by StreamProducer.

  Implements:
    getInputStream in interface StreamProducer
  Parameters:
    `name` - CURRENTLY NOT IMPLEMENTED.
    `publicID` - CURRENTLY NOT IMPLEMENTED.
    `systemID` - Entity's system ID.
  Returns:
    The resolved source of the input stream, or null if unable to resolve.
  Throws:
    java.io.IOException - Thrown if unable to open the source defined by the specified IDs.
  See Also:
    ExternalID, closeInputStream, StreamProducer

### closeInputStream

    public void closeInputStream(Source source)

  Removes the input stream currently in use.

  This method is defined by StreamProducer.

  Implements:
    closeInputStream in interface StreamProducer
  Parameters:
    `source` - CURRENTLY NOT IMPLEMENTED.
  See Also:
    getInputStream, StreamProducer

Contents | Package | Class | Tree | Deprecated | Index | Help |
PREV | NEXT | SHOW LISTS | HIDE LISTS |