DOMInputImpl
represents a single input source for an XML entity.
This Class allows an application to encapsulate information about an input source in a single object, which may include a public identifier, a system identifier, a byte stream (possibly with a specified encoding), and/or a character stream.
The exact definitions of a byte stream and a character stream are binding dependent.
There are two places that the application will deliver this input
source to the parser: as the argument to the parse
method,
or as the return value of the DOMResourceResolver.resolveEntity
method.
The DOMParser
will use the LSInput
object to determine how to read XML input. If there is a character stream
available, the parser will read that stream directly; if not, the parser
will use a byte stream, if available; if neither a character stream nor a
byte stream is available, the parser will attempt to open a URI
connection to the resource identified by the system identifier.
An LSInput
object belongs to the application: the
parser shall never modify it in any way (it may modify a copy if
necessary). Eventhough all attributes in this interface are writable the
DOM implementation is expected to never mutate a LSInput.
See also the Document Object Model (DOM) Level 3 Abstract Schemas and Load and Save Specification.
Modifier and Type | Field and Description |
---|---|
protected String | |
protected InputStream | |
protected boolean | |
protected Reader | |
protected String | |
protected String | |
protected String | |
protected String |
Access | Constructor and Description |
---|---|
public | |
public | DOMInputImpl(String
The public identifier, if known. publicId, String The system identifier. This value should
always be set, if possible, and can be
relative or absolute. If the system identifier
is relative, then the base system identifier
should be set. systemId, String The base system identifier. This value should
always be set to the fully expanded URI of the
base system identifier, if possible. baseSystemId)Constructs an input source from just the public and system identifiers, leaving resolution of the entity and opening of the input stream up to the caller. |
public | DOMInputImpl(String
The public identifier, if known. publicId, String The system identifier. This value should
always be set, if possible, and can be
relative or absolute. If the system identifier
is relative, then the base system identifier
should be set. systemId, String The base system identifier. This value should
always be set to the fully expanded URI of the
base system identifier, if possible. baseSystemId, InputStream The byte stream. byteStream, String The encoding of the byte stream, if known. encoding)Constructs an input source from a byte stream. |
public | DOMInputImpl(String
The public identifier, if known. publicId, String The system identifier. This value should
always be set, if possible, and can be
relative or absolute. If the system identifier
is relative, then the base system identifier
should be set. systemId, String The base system identifier. This value should
always be set to the fully expanded URI of the
base system identifier, if possible. baseSystemId, Reader The character stream. charStream, String The original encoding of the byte stream
used by the reader, if known. encoding)Constructs an input source from a character stream. |
public | DOMInputImpl(String
The public identifier, if known. publicId, String The system identifier. This value should
always be set, if possible, and can be
relative or absolute. If the system identifier
is relative, then the base system identifier
should be set. systemId, String The base system identifier. This value should
always be set to the fully expanded URI of the
base system identifier, if possible. baseSystemId, String The String Data. data, String The original encoding of the byte stream
used by the reader, if known. encoding)Constructs an input source from a String. |
Modifier and Type | Method and Description |
---|---|
public String | getBaseURI()
Implements org. The base URI to be used (see section 5.1.4 in ) for resolving relative URIs to absolute URIs. |
public InputStream | getByteStream()
Implements org. An attribute of a language-binding dependent type that represents a stream of bytes. |
public boolean | getCertifiedText()
Implements org. If set to true, assume that the input is certified (see section 2.13 in [XML 1.1]) when parsing [XML 1.1]. |
public Reader | getCharacterStream()
Implements org. An attribute of a language-binding dependent type that represents a stream of 16-bit units. |
public String | |
public String | getPublicId()
Implements org. The public identifier for this input source. |
public String | getStringData()
Implements org. A string attribute that represents a sequence of 16 bit units (utf-16 encoded characters). |
public String | getSystemId()
Implements org. The system identifier, a URI reference , for this input source. |
public void | setBaseURI(String baseURI)
Implements org. The base URI to be used (see section 5.1.4 in ) for resolving relative URIs to absolute URIs. |
public void | setByteStream(InputStream byteStream)
Implements org. An attribute of a language-binding dependent type that represents a stream of bytes. |
public void | setCertifiedText(boolean certifiedText)
Implements org. If set to true, assume that the input is certified (see section 2.13 in [XML 1.1]) when parsing [XML 1.1]. |
public void | setCharacterStream(Reader characterStream)
Implements org. An attribute of a language-binding dependent type that represents a stream of 16-bit units. |
public void | setEncoding(String encoding)
Implements org. The character encoding, if known. |
public void | setPublicId(String publicId)
Implements org. The public identifier for this input source. |
public void | setStringData(String stringData)
Implements org. A string attribute that represents a sequence of 16 bit units (utf-16 encoded characters). |
public void | setSystemId(String systemId)
Implements org. The system identifier, a URI reference , for this input source. |
fBaseSystemId | back to summary |
---|---|
protected String fBaseSystemId |
fByteStream | back to summary |
---|---|
protected InputStream fByteStream |
fCertifiedText | back to summary |
---|---|
protected boolean fCertifiedText |
fCharStream | back to summary |
---|---|
protected Reader fCharStream |
fData | back to summary |
---|---|
protected String fData |
fEncoding | back to summary |
---|---|
protected String fEncoding |
fPublicId | back to summary |
---|---|
protected String fPublicId |
fSystemId | back to summary |
---|---|
protected String fSystemId |
DOMInputImpl | back to summary |
---|---|
public DOMInputImpl() Default Constructor, constructs an input source |
DOMInputImpl | back to summary |
---|---|
public DOMInputImpl(String publicId, String systemId, String baseSystemId) Constructs an input source from just the public and system identifiers, leaving resolution of the entity and opening of the input stream up to the caller.
|
DOMInputImpl | back to summary |
---|---|
public DOMInputImpl(String publicId, String systemId, String baseSystemId, InputStream byteStream, String encoding) Constructs an input source from a byte stream.
|
DOMInputImpl | back to summary |
---|---|
public DOMInputImpl(String publicId, String systemId, String baseSystemId, Reader charStream, String encoding) Constructs an input source from a character stream.
|
DOMInputImpl | back to summary |
---|---|
public DOMInputImpl(String publicId, String systemId, String baseSystemId, String data, String encoding) Constructs an input source from a String.
|
getBaseURI | back to summary |
---|---|
public String getBaseURI() Implements org. The base URI to be used (see section 5.1.4 in ) for resolving relative URIs to absolute URIs. If the baseURI is itself a relative URI, the behavior is implementation dependent. |
getByteStream | back to summary |
---|---|
public InputStream getByteStream() Implements org. An attribute of a language-binding dependent type that represents a
stream of bytes.
|
getCertifiedText | back to summary |
---|---|
public boolean getCertifiedText() Implements org. If set to true, assume that the input is certified (see section 2.13 in [XML 1.1]) when parsing [XML 1.1]. |
getCharacterStream | back to summary |
---|---|
public Reader getCharacterStream() Implements org. An attribute of a language-binding dependent type that represents a
stream of 16-bit units. Application must encode the stream using
UTF-16 (defined in and Amendment 1 of ).
|
getEncoding | back to summary |
---|---|
public String getEncoding() Implements org. The character encoding, if known. The encoding must be a string
acceptable for an XML encoding declaration ( section 4.3.3 "Character
Encoding in Entities").
|
getPublicId | back to summary |
---|---|
public String getPublicId() Implements org. The public identifier for this input source. The public identifier is always optional: if the application writer includes one, it will be provided as part of the location information. |
getStringData | back to summary |
---|---|
public String getStringData() Implements org. A string attribute that represents a sequence of 16 bit units (utf-16
encoded characters).
|
getSystemId | back to summary |
---|---|
public String getSystemId() Implements org. The system identifier, a URI reference , for this input source. The
system identifier is optional if there is a byte stream or a
character stream, but it is still useful to provide one, since the
application can use it to resolve relative URIs and can include it in
error messages and warnings (the parser will attempt to fetch the
ressource identifier by the URI reference only if there is no byte
stream or character stream specified).
|
setBaseURI | back to summary |
---|---|
public void setBaseURI(String baseURI) Implements org. The base URI to be used (see section 5.1.4 in ) for resolving relative URIs to absolute URIs. If the baseURI is itself a relative URI, the behavior is implementation dependent. |
setByteStream | back to summary |
---|---|
public void setByteStream(InputStream byteStream) Implements org. An attribute of a language-binding dependent type that represents a
stream of bytes.
|
setCertifiedText | back to summary |
---|---|
public void setCertifiedText(boolean certifiedText) Implements org. If set to true, assume that the input is certified (see section 2.13 in [XML 1.1]) when parsing [XML 1.1]. |
setCharacterStream | back to summary |
---|---|
public void setCharacterStream(Reader characterStream) Implements org. An attribute of a language-binding dependent type that represents a
stream of 16-bit units. Application must encode the stream using
UTF-16 (defined in and Amendment 1 of ).
|
setEncoding | back to summary |
---|---|
public void setEncoding(String encoding) Implements org. The character encoding, if known. The encoding must be a string
acceptable for an XML encoding declaration ( section 4.3.3 "Character
Encoding in Entities").
|
setPublicId | back to summary |
---|---|
public void setPublicId(String publicId) Implements org. The public identifier for this input source. The public identifier is always optional: if the application writer includes one, it will be provided as part of the location information. |
setStringData | back to summary |
---|---|
public void setStringData(String stringData) Implements org. A string attribute that represents a sequence of 16 bit units (utf-16
encoded characters).
|
setSystemId | back to summary |
---|---|
public void setSystemId(String systemId) Implements org. The system identifier, a URI reference , for this input source. The
system identifier is optional if there is a byte stream or a
character stream, but it is still useful to provide one, since the
application can use it to resolve relative URIs and can include it in
error messages and warnings (the parser will attempt to fetch the
ressource identifier by the URI reference only if there is no byte
stream or character stream specified).
|