public interface OMDataSourceExt extends OMDataSource
OMDataSource
,
OMSourcedElement
Modifier and Type | Field and Description |
---|---|
static String |
LOSSY_PREFIX
Deprecated.
To create an
OMSourcedElement with unknown prefix, use
OMFactory.createOMElement(OMDataSource, String, OMNamespace) and pass
null as prefix. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the DataSource and free its resources.
|
OMDataSourceExt |
copy()
Create a copy of the data source.
|
Object |
getObject()
Get the object that backs this data source.
|
Object |
getProperty(String key)
Query a property stored on the OMDataSource
|
byte[] |
getXMLBytes(String encoding)
Returns a byte[] representing the xml data
|
InputStream |
getXMLInputStream(String encoding)
Returns a InputStream representing the xml data
|
boolean |
hasProperty(String key)
Returns true if property is set
|
boolean |
isDestructiveRead()
Returns true if reading the backing object is destructive.
|
boolean |
isDestructiveWrite()
Returns true if writing the backing object is destructive.
|
Object |
setProperty(String key,
Object value)
Set a property on the OMDataSource
|
getReader, serialize, serialize, serialize
static final String LOSSY_PREFIX
OMSourcedElement
with unknown prefix, use
OMFactory.createOMElement(OMDataSource, String, OMNamespace)
and pass
null
as prefix.Object getObject()
OMSourcedElement.getObject(Class)
instead.
Data sources that support non destructive read/write should return the object from which the XML is produced. Data sources with destructive read/write should return a non null value only if the backing object has not been consumed yet (even partially).
null
if the data source has no backing object or
if the backing object can't be accessed in a safe wayboolean isDestructiveRead()
boolean isDestructiveWrite()
InputStream getXMLInputStream(String encoding) throws UnsupportedEncodingException
encoding
- String encoding of InputStreamUnsupportedEncodingException
byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException
encoding
- String encoding of InputStreamUnsupportedEncodingException
getXMLInputStream(String)
void close()
OMDataSourceExt copy()
OMInformationItem.clone(OMCloneOptions)
when the
OMCloneOptions.isCopyOMDataSources()
option is enabled. If the data source is
immutable and stateless, then it may return a reference to itself instead of creating a new
data source instance.null
if the data source can't be copied
(e.g. because it is destructive)boolean hasProperty(String key)
key
- Object getProperty(String key)
key
- Copyright © The Apache Software Foundation. All Rights Reserved.