Java Doc for XMLDecoder.java in  » 6.0-JDK-Core » beans » java » beans » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » beans » java.beans 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.beans.XMLDecoder

XMLDecoder
public class XMLDecoder (Code)
The XMLDecoder class is used to read XML documents created using the XMLEncoder and is used just like the ObjectInputStream. For example, one can use the following fragment to read the first object defined in an XML document written by the XMLEncoder class:
 XMLDecoder d = new XMLDecoder(
 new BufferedInputStream(
 new FileInputStream("Test.xml")));
 Object result = d.readObject();
 d.close();
 

For more information you might also want to check out Long Term Persistence of JavaBeans Components: XML Schema, an article in The Swing Connection.
See Also:   XMLEncoder
See Also:   java.io.ObjectInputStream
since:
   1.4
version:
   1.38 05/05/07
author:
   Philip Milne




Constructor Summary
public  XMLDecoder(InputStream in)
     Creates a new input stream for reading archives created by the XMLEncoder class.
public  XMLDecoder(InputStream in, Object owner)
     Creates a new input stream for reading archives created by the XMLEncoder class.
public  XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener)
     Creates a new input stream for reading archives created by the XMLEncoder class.
public  XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener, ClassLoader cl)
     Creates a new input stream for reading archives created by the XMLEncoder class.

Method Summary
public  voidclose()
     This method closes the input stream associated with this stream.
public  ExceptionListenergetExceptionListener()
     Gets the exception handler for this stream.
public  ObjectgetOwner()
     Gets the owner of this decoder.
public  ObjectreadObject()
     Reads the next object from the underlying input stream.
public  voidsetExceptionListener(ExceptionListener exceptionListener)
     Sets the exception handler for this stream to exceptionListener.
public  voidsetOwner(Object owner)
     Sets the owner of this decoder to owner.


Constructor Detail
XMLDecoder
public XMLDecoder(InputStream in)(Code)
Creates a new input stream for reading archives created by the XMLEncoder class.
Parameters:
  in - The underlying stream.
See Also:   XMLEncoder.XMLEncoder(java.io.OutputStream)



XMLDecoder
public XMLDecoder(InputStream in, Object owner)(Code)
Creates a new input stream for reading archives created by the XMLEncoder class.
Parameters:
  in - The underlying stream.
Parameters:
  owner - The owner of this stream.



XMLDecoder
public XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener)(Code)
Creates a new input stream for reading archives created by the XMLEncoder class.
Parameters:
  in - the underlying stream.
Parameters:
  owner - the owner of this stream.
Parameters:
  exceptionListener - the exception handler for the stream;if null the default exception listener will be used.



XMLDecoder
public XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener, ClassLoader cl)(Code)
Creates a new input stream for reading archives created by the XMLEncoder class.
Parameters:
  in - the underlying stream. null may be passed withouterror, though the resulting XMLDecoder will be useless
Parameters:
  owner - the owner of this stream. null is a legalvalue
Parameters:
  exceptionListener - the exception handler for the stream, ornull to use the default
Parameters:
  cl - the class loader used for instantiating objects. null indicates that the default class loader shouldbe used
since:
   1.5




Method Detail
close
public void close()(Code)
This method closes the input stream associated with this stream.



getExceptionListener
public ExceptionListener getExceptionListener()(Code)
Gets the exception handler for this stream. The exception handler for this stream. Will return the default exception listener if this has not explicitly been set.
See Also:   XMLDecoder.setExceptionListener



getOwner
public Object getOwner()(Code)
Gets the owner of this decoder. The owner of this decoder.
See Also:   XMLDecoder.setOwner



readObject
public Object readObject()(Code)
Reads the next object from the underlying input stream. the next object read
throws:
  ArrayIndexOutOfBoundsException - if the stream contains no objects (or no more objects)
See Also:   XMLEncoder.writeObject



setExceptionListener
public void setExceptionListener(ExceptionListener exceptionListener)(Code)
Sets the exception handler for this stream to exceptionListener. The exception handler is notified when this stream catches recoverable exceptions.
Parameters:
  exceptionListener - The exception handler for this stream;if null the default exception listener will be used.
See Also:   XMLDecoder.getExceptionListener



setOwner
public void setOwner(Object owner)(Code)
Sets the owner of this decoder to owner.
Parameters:
  owner - The owner of this decoder.
See Also:   XMLDecoder.getOwner



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.