gnu.xml.dom.ls

Class DomLSInput

Implemented Interfaces:
LSInput

public class DomLSInput
extends Object
implements LSInput

Specification of XML input to parse.

Method Summary

String
getBaseURI()
The base URI to be used (see section 5.1.4 in [IETF RFC 2396]) for resolving a relative systemId to an absolute URI.
InputStream
getByteStream()
An attribute of a language and binding dependent type that represents a stream of bytes.
boolean
getCertifiedText()
If set to true, assume that the input is certified (see section 2.13 in [XML 1.1]) when parsing [XML 1.1].
Reader
getCharacterStream()
An attribute of a language and binding dependent type that represents a stream of 16-bit units.
String
getEncoding()
The character encoding, if known.
String
getPublicId()
The public identifier for this input source.
String
getStringData()
String data to parse.
String
getSystemId()
The system identifier, a URI reference [IETF RFC 2396], for this input source.
void
setBaseURI(String baseURI)
The base URI to be used (see section 5.1.4 in [IETF RFC 2396]) for resolving a relative systemId to an absolute URI.
void
setByteStream(InputStream byteStream)
An attribute of a language and binding dependent type that represents a stream of bytes.
void
setCertifiedText(boolean certifiedText)
If set to true, assume that the input is certified (see section 2.13 in [XML 1.1]) when parsing [XML 1.1].
void
setCharacterStream(Reader characterStream)
An attribute of a language and binding dependent type that represents a stream of 16-bit units.
void
setEncoding(String encoding)
The character encoding, if known.
void
setPublicId(String publicId)
The public identifier for this input source.
void
setStringData(String stringData)
String data to parse.
void
setSystemId(String systemId)
The system identifier, a URI reference [IETF RFC 2396], for this input source.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Details

getBaseURI

public String getBaseURI()
The base URI to be used (see section 5.1.4 in [IETF RFC 2396]) for resolving a relative systemId to an absolute URI.
If, when used, the base URI is itself a relative URI, an empty string, or null, the behavior is implementation dependent.
Specified by:
getBaseURI in interface LSInput

getByteStream

public InputStream getByteStream()
An attribute of a language and binding dependent type that represents a stream of bytes.
If the application knows the character encoding of the byte stream, it should set the encoding attribute. Setting the encoding in this way will override any encoding specified in an XML declaration in the data.
Specified by:
getByteStream in interface LSInput

getCertifiedText

public boolean getCertifiedText()
If set to true, assume that the input is certified (see section 2.13 in [XML 1.1]) when parsing [XML 1.1].
Specified by:
getCertifiedText in interface LSInput

getCharacterStream

public Reader getCharacterStream()
An attribute of a language and binding dependent type that represents a stream of 16-bit units. The application must encode the stream using UTF-16 (defined in [Unicode] and in [ISO/IEC 10646]). It is not a requirement to have an XML declaration when using character streams. If an XML declaration is present, the value of the encoding attribute will be ignored.
Specified by:
getCharacterStream in interface LSInput

getEncoding

public String getEncoding()
The character encoding, if known. The encoding must be a string acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3 "Character Encoding in Entities").
This attribute has no effect when the application provides a character stream or string data. For other sources of input, an encoding specified by means of this attribute will override any encoding specified in the XML declaration or the Text declaration, or an encoding obtained from a higher level protocol, such as HTTP [IETF RFC 2616].
Specified by:
getEncoding in interface LSInput

getPublicId

public String getPublicId()
The public identifier for this input source. This may be mapped to an input source using an implementation dependent mechanism (such as catalogues or other mappings). The public identifier, if specified, may also be reported as part of the location information when errors are reported.
Specified by:
getPublicId in interface LSInput

getStringData

public String getStringData()
String data to parse. If provided, this will always be treated as a sequence of 16-bit units (UTF-16 encoded characters). It is not a requirement to have an XML declaration when using stringData. If an XML declaration is present, the value of the encoding attribute will be ignored.
Specified by:
getStringData in interface LSInput

getSystemId

public String getSystemId()
The system identifier, a URI reference [IETF RFC 2396], for this input source. The system identifier is optional if there is a byte stream, a character stream, or string data. It is still useful to provide one, since the application will use it to resolve any relative URIs and can include it in error messages and warnings. (The LSParser will only attempt to fetch the resource identified by the URI reference if there is no other input available in the input source.)
If the application knows the character encoding of the object pointed to by the system identifier, it can set the encoding using the encoding attribute.
If the specified system ID is a relative URI reference (see section 5 in [IETF RFC 2396]), the DOM implementation will attempt to resolve the relative URI with the baseURI as the base, if that fails, the behavior is implementation dependent.
Specified by:
getSystemId in interface LSInput

setBaseURI

public void setBaseURI(String baseURI)
The base URI to be used (see section 5.1.4 in [IETF RFC 2396]) for resolving a relative systemId to an absolute URI.
If, when used, the base URI is itself a relative URI, an empty string, or null, the behavior is implementation dependent.
Specified by:
setBaseURI in interface LSInput

setByteStream

public void setByteStream(InputStream byteStream)
An attribute of a language and binding dependent type that represents a stream of bytes.
If the application knows the character encoding of the byte stream, it should set the encoding attribute. Setting the encoding in this way will override any encoding specified in an XML declaration in the data.
Specified by:
setByteStream in interface LSInput

setCertifiedText

public void setCertifiedText(boolean certifiedText)
If set to true, assume that the input is certified (see section 2.13 in [XML 1.1]) when parsing [XML 1.1].
Specified by:
setCertifiedText in interface LSInput

setCharacterStream

public void setCharacterStream(Reader characterStream)
An attribute of a language and binding dependent type that represents a stream of 16-bit units. The application must encode the stream using UTF-16 (defined in [Unicode] and in [ISO/IEC 10646]). It is not a requirement to have an XML declaration when using character streams. If an XML declaration is present, the value of the encoding attribute will be ignored.
Specified by:
setCharacterStream in interface LSInput

setEncoding

public void setEncoding(String encoding)
The character encoding, if known. The encoding must be a string acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3 "Character Encoding in Entities").
This attribute has no effect when the application provides a character stream or string data. For other sources of input, an encoding specified by means of this attribute will override any encoding specified in the XML declaration or the Text declaration, or an encoding obtained from a higher level protocol, such as HTTP [IETF RFC 2616].
Specified by:
setEncoding in interface LSInput

setPublicId

public void setPublicId(String publicId)
The public identifier for this input source. This may be mapped to an input source using an implementation dependent mechanism (such as catalogues or other mappings). The public identifier, if specified, may also be reported as part of the location information when errors are reported.
Specified by:
setPublicId in interface LSInput

setStringData

public void setStringData(String stringData)
String data to parse. If provided, this will always be treated as a sequence of 16-bit units (UTF-16 encoded characters). It is not a requirement to have an XML declaration when using stringData. If an XML declaration is present, the value of the encoding attribute will be ignored.
Specified by:
setStringData in interface LSInput

setSystemId

public void setSystemId(String systemId)
The system identifier, a URI reference [IETF RFC 2396], for this input source. The system identifier is optional if there is a byte stream, a character stream, or string data. It is still useful to provide one, since the application will use it to resolve any relative URIs and can include it in error messages and warnings. (The LSParser will only attempt to fetch the resource identified by the URI reference if there is no other input available in the input source.)
If the application knows the character encoding of the object pointed to by the system identifier, it can set the encoding using the encoding attribute.
If the specified system ID is a relative URI reference (see section 5 in [IETF RFC 2396]), the DOM implementation will attempt to resolve the relative URI with the baseURI as the base, if that fails, the behavior is implementation dependent.
Specified by:
setSystemId in interface LSInput

DomLSInput.java -- Copyright (C) 1999,2000,2001 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.