public class DOMInputImpl extends Object implements LSInput
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 |
fBaseSystemId |
protected InputStream |
fByteStream |
protected boolean |
fCertifiedText |
protected Reader |
fCharStream |
protected String |
fData |
protected String |
fEncoding |
protected String |
fPublicId |
protected String |
fSystemId |
Constructor and Description |
---|
DOMInputImpl()
Default Constructor, constructs an input source
|
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(String publicId,
String systemId,
String baseSystemId,
InputStream byteStream,
String encoding)
Constructs an input source from a byte stream.
|
DOMInputImpl(String publicId,
String systemId,
String baseSystemId,
Reader charStream,
String encoding)
Constructs an input source from a character stream.
|
DOMInputImpl(String publicId,
String systemId,
String baseSystemId,
String data,
String encoding)
Constructs an input source from a String.
|
Modifier and Type | Method and Description |
---|---|
String |
getBaseURI()
The base URI to be used (see section 5.1.4 in ) for resolving relative
URIs to absolute URIs.
|
InputStream |
getByteStream()
An attribute of a language-binding dependent type that represents a
stream of bytes.
|
boolean |
getCertifiedText()
|
Reader |
getCharacterStream()
An attribute of a language-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()
A string attribute that represents a sequence of 16 bit units (utf-16
encoded characters).
|
String |
getSystemId()
The system identifier, a URI reference , for this input source.
|
void |
setBaseURI(String baseURI)
The base URI to be used (see section 5.1.4 in ) for resolving relative
URIs to absolute URIs.
|
void |
setByteStream(InputStream byteStream)
An attribute of a language-binding dependent type that represents a
stream of bytes.
|
void |
setCertifiedText(boolean certifiedText)
|
void |
setCharacterStream(Reader characterStream)
An attribute of a language-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)
A string attribute that represents a sequence of 16 bit units (utf-16
encoded characters).
|
void |
setSystemId(String systemId)
The system identifier, a URI reference , for this input source.
|
protected String fPublicId
protected String fSystemId
protected String fBaseSystemId
protected InputStream fByteStream
protected Reader fCharStream
protected String fData
protected String fEncoding
protected boolean fCertifiedText
public DOMInputImpl()
public DOMInputImpl(String publicId, String systemId, String baseSystemId)
publicId
- The public identifier, if known.systemId
- 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.baseSystemId
- The base system identifier. This value should
always be set to the fully expanded URI of the
base system identifier, if possible.public DOMInputImpl(String publicId, String systemId, String baseSystemId, InputStream byteStream, String encoding)
publicId
- The public identifier, if known.systemId
- 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.baseSystemId
- The base system identifier. This value should
always be set to the fully expanded URI of the
base system identifier, if possible.byteStream
- The byte stream.encoding
- The encoding of the byte stream, if known.public DOMInputImpl(String publicId, String systemId, String baseSystemId, Reader charStream, String encoding)
publicId
- The public identifier, if known.systemId
- 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.baseSystemId
- The base system identifier. This value should
always be set to the fully expanded URI of the
base system identifier, if possible.charStream
- The character stream.encoding
- The original encoding of the byte stream
used by the reader, if known.public DOMInputImpl(String publicId, String systemId, String baseSystemId, String data, String encoding)
publicId
- The public identifier, if known.systemId
- 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.baseSystemId
- The base system identifier. This value should
always be set to the fully expanded URI of the
base system identifier, if possible.data
- The String Data.encoding
- The original encoding of the byte stream
used by the reader, if known.public InputStream getByteStream()
getByteStream
in interface LSInput
public void setByteStream(InputStream byteStream)
setByteStream
in interface LSInput
public Reader getCharacterStream()
getCharacterStream
in interface LSInput
public void setCharacterStream(Reader characterStream)
setCharacterStream
in interface LSInput
public String getStringData()
getStringData
in interface LSInput
public void setStringData(String stringData)
setStringData
in interface LSInput
public String getEncoding()
getEncoding
in interface LSInput
public void setEncoding(String encoding)
setEncoding
in interface LSInput
public String getPublicId()
getPublicId
in interface LSInput
public void setPublicId(String publicId)
setPublicId
in interface LSInput
public String getSystemId()
getSystemId
in interface LSInput
public void setSystemId(String systemId)
setSystemId
in interface LSInput
public String getBaseURI()
getBaseURI
in interface LSInput
public void setBaseURI(String baseURI)
setBaseURI
in interface LSInput
public boolean getCertifiedText()
getCertifiedText
in interface LSInput
public void setCertifiedText(boolean certifiedText)
setCertifiedText
in interface LSInput
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.