Javolution 6.0.0 java
|
Public Member Functions | |
XMLObjectReader () | |
XMLStreamReader | getStreamReader () |
XMLObjectReader | setInput (InputStream in) throws XMLStreamException |
XMLObjectReader | setInput (InputStream in, String encoding) throws XMLStreamException |
XMLObjectReader | setInput (Reader in) throws XMLStreamException |
XMLObjectReader | setBinding (XMLBinding binding) |
XMLObjectReader | setReferenceResolver (XMLReferenceResolver referenceResolver) |
boolean | hasNext () throws XMLStreamException |
void | close () throws XMLStreamException |
void | reset () |
Static Public Member Functions | |
static XMLObjectReader | newInstance (InputStream in) throws XMLStreamException |
static XMLObjectReader | newInstance (InputStream in, String encoding) throws XMLStreamException |
static XMLObjectReader | newInstance (Reader in) throws XMLStreamException |
Package Functions | |
public< T > T | read () throws XMLStreamException |
public< T > T | read (String name) throws XMLStreamException |
public< T > T | read (String localName, String uri) throws XMLStreamException |
public< T > T | read (String name, Class< T > cls) throws XMLStreamException |
public< T > T | read (String localName, String uri, Class< T > cls) throws XMLStreamException |
Private Attributes | |
final XMLFormat.InputElement | _xml = new XMLFormat.InputElement() |
Reader | _reader |
InputStream | _inputStream |
This class restores objects which have been serialized in XML format using an XMLObjectWriter.
When the XML document is parsed, each elements are recursively processed and Java objects are created using the XMLFormat of the class as identified by the XMLBinding.
Multiple objects can be read from the same XML input. For example:[code] XMLObjectReader reader = XMLObjectReader.newInstance(inputStream); while (reader.hasNext()) { Message message = reader.read("Message", Message.class); } reader.close(); // The underlying stream is closed. [/code]
Definition at line 39 of file XMLObjectReader.java.
javolution.xml.XMLObjectReader.XMLObjectReader | ( | ) |
Default constructor.
Definition at line 99 of file XMLObjectReader.java.
Referenced by javolution.xml.XMLObjectReader.newInstance().
void javolution.xml.XMLObjectReader.close | ( | ) | throws XMLStreamException |
Closes this reader and its underlying input then reset this reader for potential reuse.
Definition at line 269 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._inputStream, javolution.xml.XMLObjectReader._reader, and javolution.xml.XMLObjectReader.reset().
Referenced by javolution.xml.ws.WebServiceClient.invoke().
XMLStreamReader javolution.xml.XMLObjectReader.getStreamReader | ( | ) |
Returns the stream reader being used by this reader (it can be used to set prefix, read prologs, etc).
Definition at line 107 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
Referenced by javolution.xml.ws.WebServiceClient.invoke().
boolean javolution.xml.XMLObjectReader.hasNext | ( | ) | throws XMLStreamException |
Indicates if more elements can be read. This method positions the reader at the start of the next element to be read (if any).
true
if more element/data to be read; false
otherwise. Definition at line 192 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
|
static |
Returns a XML object reader having the specified input stream as input.
in | the input stream. |
Definition at line 62 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader.setInput(), and javolution.xml.XMLObjectReader.XMLObjectReader().
|
static |
Returns a XML object reader (potentially recycled) having the specified input stream/encoding as input.
in | the input stream. |
encoding | the input stream encoding |
Definition at line 76 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader.setInput(), and javolution.xml.XMLObjectReader.XMLObjectReader().
|
static |
Returns a XML object reader (potentially recycled) having the specified reader as input.
in | the reader source. |
Definition at line 89 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader.setInput(), and javolution.xml.XMLObjectReader.XMLObjectReader().
|
package |
Returns the object corresponding to the next element/data.
null
) XMLStreamException | if hasNext() == false |
Definition at line 204 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
|
package |
Returns the object corresponding to the next nested element only if it has the specified local name and namespace URI.
localName | the local name. |
uri | the namespace URI. |
null
if the name/uri does not match. Definition at line 233 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
|
package |
Returns the object corresponding to the next nested element only if it has the specified local name and namespace URI; the actual object type is identified by the specified class parameter.
localName | the local name. |
uri | the namespace URI. |
cls | the non-abstract class identifying the object to return. |
null
if no match. Definition at line 260 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
|
package |
Returns the object corresponding to the next nested element only if it has the specified local name.
name | the local name of the next element. |
null
if the local name does not match. Definition at line 218 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
|
package |
Returns the object corresponding to the next nested element only if it has the specified local name; the actual object type is identified by the specified class parameter.
name | the name of the element to match. |
cls | the non-abstract class identifying the object to return. |
read(name, null, cls)
Definition at line 246 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
void javolution.xml.XMLObjectReader.reset | ( | ) |
Resets this object reader for reuse.
Definition at line 286 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._inputStream, javolution.xml.XMLObjectReader._reader, and javolution.xml.XMLObjectReader._xml.
Referenced by javolution.xml.XMLObjectReader.close(), and javolution.xml.ws.WebServiceClient.invoke().
XMLObjectReader javolution.xml.XMLObjectReader.setBinding | ( | XMLBinding | binding | ) |
Sets the XML binding to use with this object reader.
binding | the XML binding to use. |
this
Definition at line 165 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
XMLObjectReader javolution.xml.XMLObjectReader.setInput | ( | InputStream | in | ) | throws XMLStreamException |
Sets the input stream source for this XML object reader (encoding retrieved from XML prolog if any).
in | the source input stream. |
this
Definition at line 119 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._inputStream, javolution.xml.XMLObjectReader._reader, and javolution.xml.XMLObjectReader._xml.
Referenced by javolution.xml.ws.WebServiceClient.invoke(), and javolution.xml.XMLObjectReader.newInstance().
XMLObjectReader javolution.xml.XMLObjectReader.setInput | ( | InputStream | in, |
String | encoding | ||
) | throws XMLStreamException |
Sets the input stream source and encoding for this XML object reader.
in | the input source. |
encoding | the associated encoding. |
this
Definition at line 135 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._inputStream, javolution.xml.XMLObjectReader._reader, and javolution.xml.XMLObjectReader._xml.
XMLObjectReader javolution.xml.XMLObjectReader.setInput | ( | Reader | in | ) | throws XMLStreamException |
Sets the reader input source for this XML stream reader.
in | the source reader. |
this
Definition at line 151 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._inputStream, javolution.xml.XMLObjectReader._reader, and javolution.xml.XMLObjectReader._xml.
XMLObjectReader javolution.xml.XMLObjectReader.setReferenceResolver | ( | XMLReferenceResolver | referenceResolver | ) |
Sets the XML reference resolver to use with this object reader (the same resolver can be used accross multiple readers).
referenceResolver | the XML reference resolver. |
this
Definition at line 177 of file XMLObjectReader.java.
References javolution.xml.XMLObjectReader._xml.
|
private |
Holds input stream if any.
Definition at line 54 of file XMLObjectReader.java.
Referenced by javolution.xml.XMLObjectReader.close(), javolution.xml.XMLObjectReader.reset(), and javolution.xml.XMLObjectReader.setInput().
|
private |
Holds reader if any.
Definition at line 49 of file XMLObjectReader.java.
Referenced by javolution.xml.XMLObjectReader.close(), javolution.xml.XMLObjectReader.reset(), and javolution.xml.XMLObjectReader.setInput().
|
private |
Hold the xml element used when parsing.
Definition at line 44 of file XMLObjectReader.java.
Referenced by javolution.xml.XMLObjectReader.getStreamReader(), javolution.xml.XMLObjectReader.hasNext(), javolution.xml.XMLObjectReader.read(), javolution.xml.XMLObjectReader.reset(), javolution.xml.XMLObjectReader.setBinding(), javolution.xml.XMLObjectReader.setInput(), and javolution.xml.XMLObjectReader.setReferenceResolver().