|
||||||||||
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
,
OMSourceElementImpl
Method Summary | |
---|---|
void |
close()
Close the DataSource and free its resources. |
OMDataSourceExt |
copy()
Create a copy of the OMDataSourceExt |
java.lang.Object |
getObject()
Returns the backing Object. |
java.lang.Object |
getProperty(java.lang.String key)
Query a property stored on the OMDataSource |
javax.xml.stream.XMLStreamReader |
getReader()
Get parser for element data. |
byte[] |
getXMLBytes(java.lang.String encoding)
Returns a byte[] representing the xml data |
java.io.InputStream |
getXMLInputStream(java.lang.String encoding)
Returns a InputStream representing the xml data |
boolean |
hasProperty(java.lang.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(java.io.OutputStream output,
OMOutputFormat format)
Serializes element data directly to stream. |
void |
serialize(java.io.Writer writer,
OMOutputFormat format)
Serializes element data directly to writer. |
void |
serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
Serializes element data directly to StAX writer. |
java.lang.Object |
setProperty(java.lang.String key,
java.lang.Object value)
Set a property on the OMDataSource |
Method Detail |
---|
void serialize(java.io.OutputStream output, OMOutputFormat format) throws javax.xml.stream.XMLStreamException
serialize
in interface OMDataSource
output
- destination stream for element XML textformat
- output format information (null
if none; may
be ignored if not supported by data binding even if supplied)
javax.xml.stream.XMLStreamException
OMDataSourceExt
void serialize(java.io.Writer writer, OMOutputFormat format) throws javax.xml.stream.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)
javax.xml.stream.XMLStreamException
OMDataSourceExt
void serialize(javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException
serialize
in interface OMDataSource
xmlWriter
- destination writer
javax.xml.stream.XMLStreamException
OMDataSourceExt
javax.xml.stream.XMLStreamReader getReader() throws javax.xml.stream.XMLStreamException
getReader
in interface OMDataSource
javax.xml.stream.XMLStreamException
java.lang.Object getObject()
boolean isDestructiveRead()
boolean isDestructiveWrite()
java.io.InputStream getXMLInputStream(java.lang.String encoding) throws java.io.UnsupportedEncodingException
encoding
- String encoding of InputStream
java.io.UnsupportedEncodingException
byte[] getXMLBytes(java.lang.String encoding) throws java.io.UnsupportedEncodingException
encoding
- String encoding of InputStream
java.io.UnsupportedEncodingException
getXMLInputStream
void close()
OMDataSourceExt copy()
boolean hasProperty(java.lang.String key)
key
-
java.lang.Object getProperty(java.lang.String key)
key
-
java.lang.Object setProperty(java.lang.String key, java.lang.Object value)
key
- value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |