Java Doc for XMLObjectReader.java in  » Development » Javolution » javolution » xml » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » Javolution » javolution.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javolution.xml.XMLObjectReader

XMLObjectReader
public class XMLObjectReader implements Reusable(Code)

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(); // Reader is recycled, the underlying stream is closed. [/code]


author:
   Jean-Marie Dautelle
version:
   4.0, September 4, 2006



Constructor Summary
public  XMLObjectReader()
     Default constructor.

Method Summary
public  voidclose()
     Closes this reader and its underlying input then XMLObjectReader.reset reset this reader for potential reuse.
public  XMLStreamReadergetStreamReader()
     Returns the stream reader being used by this reader (it can be used to set prefix, read prologs, etc).
public  booleanhasNext()
     Indicates if more elements can be read.
public static  XMLObjectReadernewInstance(InputStream in)
     Returns a XML object reader (potentially recycled) having the specified input stream as input.
public static  XMLObjectReadernewInstance(InputStream in, String encoding)
     Returns a XML object reader (potentially recycled) having the specified input stream/encoding as input.
public static  XMLObjectReadernewInstance(Reader in)
     Returns a XML object reader (potentially recycled) having the specified reader as input.
public  Objectread()
     Returns the object corresponding to the next element/data.
public  Objectread(String name)
     Returns the object corresponding to the next nested element only if it has the specified local name.
public  Objectread(String localName, String uri)
     Returns the object corresponding to the next nested element only if it has the specified local name and namespace URI.
Parameters:
  localName - the local name.
Parameters:
  uri - the namespace URI.
public  Objectread(String name, Class cls)
     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.
public  Objectread(String localName, String uri, Class cls)
     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.
public  voidreset()
     Resets this object reader for reuse.
public  XMLObjectReadersetBinding(XMLBinding binding)
     Sets the XML binding to use with this object reader.
Parameters:
  binding - the XML binding to use.
public  XMLObjectReadersetInput(InputStream in)
     Sets the input stream source for this XML object reader (encoding retrieved from XML prolog if any).
Parameters:
  in - the source input stream.
public  XMLObjectReadersetInput(InputStream in, String encoding)
     Sets the input stream source and encoding for this XML object reader.
Parameters:
  in - the input source.
Parameters:
  encoding - the associated encoding.
public  XMLObjectReadersetInput(Reader in)
     Sets the reader input source for this XML stream reader.
public  XMLObjectReadersetReferenceResolver(XMLReferenceResolver referenceResolver)
     Sets the XML reference resolver to use with this object reader (the same resolver can be used accross multiple readers).
Parameters:
  referenceResolver - the XML reference resolver.


Constructor Detail
XMLObjectReader
public XMLObjectReader()(Code)
Default constructor.




Method Detail
close
public void close() throws XMLStreamException(Code)
Closes this reader and its underlying input then XMLObjectReader.reset reset this reader for potential reuse.



getStreamReader
public XMLStreamReader getStreamReader()(Code)
Returns the stream reader being used by this reader (it can be used to set prefix, read prologs, etc). the stream reader.



hasNext
public boolean hasNext() throws XMLStreamException(Code)
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.
See Also:   XMLFormat.InputElement.hasNext



newInstance
public static XMLObjectReader newInstance(InputStream in) throws XMLStreamException(Code)
Returns a XML object reader (potentially recycled) having the specified input stream as input.
Parameters:
  in - the input stream.



newInstance
public static XMLObjectReader newInstance(InputStream in, String encoding) throws XMLStreamException(Code)
Returns a XML object reader (potentially recycled) having the specified input stream/encoding as input.
Parameters:
  in - the input stream.
Parameters:
  encoding - the input stream encoding



newInstance
public static XMLObjectReader newInstance(Reader in) throws XMLStreamException(Code)
Returns a XML object reader (potentially recycled) having the specified reader as input.
Parameters:
  in - the reader source.



read
public Object read() throws XMLStreamException(Code)
Returns the object corresponding to the next element/data. the next nested object (can be null)
throws:
  XMLStreamException - if hasNext() == false
See Also:   XMLFormat.InputElement.getNext



read
public Object read(String name) throws XMLStreamException(Code)
Returns the object corresponding to the next nested element only if it has the specified local name.
Parameters:
  name - the local name of the next element. the next content object or null if the local name does not match.
See Also:   XMLFormat.InputElement.get(String)



read
public Object read(String localName, String uri) throws XMLStreamException(Code)
Returns the object corresponding to the next nested element only if it has the specified local name and namespace URI.
Parameters:
  localName - the local name.
Parameters:
  uri - the namespace URI. the next content object or null if the name/uri does not match.
See Also:   XMLFormat.InputElement.get(StringString)



read
public Object read(String name, Class cls) throws XMLStreamException(Code)
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.
Parameters:
  name - the name of the element to match.
Parameters:
  cls - the non-abstract class identifying the object to return. read(name, null, cls)



read
public Object read(String localName, String uri, Class cls) throws XMLStreamException(Code)
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.
Parameters:
  localName - the local name.
Parameters:
  uri - the namespace URI.
Parameters:
  cls - the non-abstract class identifying the object to return. the next content object or null if no match.



reset
public void reset()(Code)
Resets this object reader for reuse.



setBinding
public XMLObjectReader setBinding(XMLBinding binding)(Code)
Sets the XML binding to use with this object reader.
Parameters:
  binding - the XML binding to use. this



setInput
public XMLObjectReader setInput(InputStream in) throws XMLStreamException(Code)
Sets the input stream source for this XML object reader (encoding retrieved from XML prolog if any).
Parameters:
  in - the source input stream. this
See Also:   XMLStreamReaderImpl.setInput(InputStream)



setInput
public XMLObjectReader setInput(InputStream in, String encoding) throws XMLStreamException(Code)
Sets the input stream source and encoding for this XML object reader.
Parameters:
  in - the input source.
Parameters:
  encoding - the associated encoding. this
See Also:   XMLStreamReaderImpl.setInput(InputStreamString)



setInput
public XMLObjectReader setInput(Reader in) throws XMLStreamException(Code)
Sets the reader input source for this XML stream reader.
Parameters:
  in - the source reader. this
See Also:   XMLStreamReaderImpl.setInput(Reader)



setReferenceResolver
public XMLObjectReader setReferenceResolver(XMLReferenceResolver referenceResolver)(Code)
Sets the XML reference resolver to use with this object reader (the same resolver can be used accross multiple readers).
Parameters:
  referenceResolver - the XML reference resolver. this



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.