|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OMDataSourceExt
Interface to a backing object that can can be read and written as XML. To plug an arbitrary object into an OM tree. Follow these steps 1) Provide a class that implements OMDataSourceExt. 2) Use OMFactory.createOMElement(OMDataSource, String, OMNamespace) to build an OMSourcedElement. 3) Add the OMSourcedElement to the OM tree. OMDataSourceExt provides additional methods that are not available on the original OMDataSource.
OMDataSource
,
OMSourcedElement
Field Summary | |
---|---|
static String |
LOSSY_PREFIX
|
Method Summary | |
---|---|
void |
close()
Close the DataSource and free its resources. |
OMDataSourceExt |
copy()
Create a copy of the OMDataSourceExt |
Object |
getObject()
Returns the backing Object. |
Object |
getProperty(String key)
Query a property stored on the OMDataSource |
XMLStreamReader |
getReader()
Get parser for element data. |
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. |
void |
serialize(OutputStream output,
OMOutputFormat format)
Serializes element data directly to stream. |
void |
serialize(Writer writer,
OMOutputFormat format)
Serializes element data directly to writer. |
void |
serialize(XMLStreamWriter xmlWriter)
Serializes element data directly to StAX writer. |
Object |
setProperty(String key,
Object value)
Set a property on the OMDataSource |
Field Detail |
---|
static final String LOSSY_PREFIX
Method Detail |
---|
void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException
serialize
in interface OMDataSource
output
- destination stream for element XML textformat
- Output format information. The implementation must use this information
to choose the correct character set encoding when writing to the
output stream. This parameter must not be null.
XMLStreamException
OMDataSourceExt
void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException
serialize
in interface OMDataSource
writer
- destination writer for element XML textformat
- output format information (null
if none; may
be ignored if not supported by data binding even if supplied)
XMLStreamException
OMDataSourceExt
void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException
serialize
in interface OMDataSource
xmlWriter
- destination writer
XMLStreamException
OMDataSourceExt
XMLStreamReader getReader() throws XMLStreamException
getReader
in interface OMDataSource
XMLStreamException
Object getObject()
boolean isDestructiveRead()
boolean isDestructiveWrite()
InputStream getXMLInputStream(String encoding) throws UnsupportedEncodingException
encoding
- String encoding of InputStream
UnsupportedEncodingException
byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException
encoding
- String encoding of InputStream
UnsupportedEncodingException
getXMLInputStream(String)
void close()
OMDataSourceExt copy()
boolean hasProperty(String key)
key
-
Object getProperty(String key)
key
-
Object setProperty(String key, Object value)
key
- value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |