GXPARSE hosted by SourceForge.net Logo

ca.gorman.xml.parse
Class Input

java.lang.Object
  extended by ca.gorman.xml.parse.Input

public class Input
extends Object

Supports several different ways of naming an XML input source.

The input reader will respond in an application specific manner when the input source is named in more than one way, in conflicting ways, or in a way not supported by the input reader.

A Reader contains a stream encoded as Java characters.

An input source identified by a system identifier or a public identifier contains a stream encoded as described in Section 4.3.3 of Extensible Markup Language (XML) 1.0 (Second Edition). Any stream that begins with a UTF-16 Byte Order mark is assumed to be encoded as UTF-16 data. Any stream that begins with a Text Declaration is assumed to use the character encoding specified in the declaration. Any other stream is assumed to be encoded as UTF-8 data.

An application may accept more than one kind of source, in which case more than one can be specified at the same time. Each specification may identify a different source, but the application will use only one of the sources, choosing the kind of source that has the highest priority. Unless the application documentation specifies otherwise, reader and system identifier are supported and public identifier is not supported. Unless the application documentation specifies otherwise, only one kind of source will be read, trying each of the supported sources in the following order:

  1. reader
  2. system identifier
  3. public identifier


Constructor Summary
Input()
           Create without specifying a source.
Input(Reader reader)
           Create using a Reader as the source.
Input(String publicId)
           Create using a public identifier to name the source.
Input(URI systemId)
           Create using a system identifier to name the source.
 
Method Summary
 String getPublicId()
           Get the current public identifier.
 Reader getReader()
           Get the current Reader.
 URI getSystemId()
           Get the current system identifier.
 void setPublicId(String publicId)
           Specify a public identifier as the source.
 void setReader(Reader reader)
           Specify a Reader as the source.
 void setSystemId(URI systemId)
           Specify a system identifier as the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Input

public Input()

Create without specifying a source.


Input

public Input(Reader reader)

Create using a Reader as the source.


Input

public Input(URI systemId)

Create using a system identifier to name the source.


Input

public Input(String publicId)

Create using a public identifier to name the source.

Method Detail

setReader

public void setReader(Reader reader)

Specify a Reader as the source.

Parameters:
reader - a Reader, or null to remove the current Reader

getReader

public Reader getReader()

Get the current Reader.

Returns:
the current Reader, or null if none is set

setSystemId

public void setSystemId(URI systemId)

Specify a system identifier as the source.

Parameters:
systemId - a system identifier, or null to remove the current system identifier

getSystemId

public URI getSystemId()

Get the current system identifier.

Returns:
the current identifier, or null if none is set

setPublicId

public void setPublicId(String publicId)

Specify a public identifier as the source.

Parameters:
publicId - a public identifier, or null to remove the current public identifier

getPublicId

public String getPublicId()

Get the current public identifier.

Returns:
the current identifier, or null if none is set

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License