Java Doc for DefaultPersistenceDelegate.java in  » Apache-Harmony-Java-SE » java-package » java » beans » 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 » Apache Harmony Java SE » java package » java.beans 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.beans.PersistenceDelegate
      java.beans.DefaultPersistenceDelegate

All known Subclasses:   java.beans.SwingJFramePersistenceDelegate,  java.beans.AwtListPersistenceDelegate,  java.beans.UtilDatePersistenceDelegate,  java.beans.SwingAbstractButtonPersistenceDelegate,  java.beans.AwtMenuBarPersistenceDelegate,  java.beans.AwtChoicePersistenceDelegate,  java.beans.AwtRectanglePersistenceDelegate,  java.beans.AwtColorPersistenceDelegate,  java.beans.AwtFontPersistenceDelegate,  java.beans.UtilMapPersistenceDelegate,  java.beans.AwtDimensionPersistenceDelegate,  java.beans.AwtInsetsPersistenceDelegate,  java.beans.AwtScrollPanePersistenceDelegate,  java.beans.AwtCursorPersistenceDelegate,  java.beans.AwtPointPersistenceDelegate,  java.beans.UtilCollectionPersistenceDelegate,  java.beans.SwingJTabbedPanePersistenceDelegate,  java.beans.UtilListPersistenceDelegate,  java.beans.SwingDefaultComboBoxModelPersistenceDelegate,  java.beans.ProxyPersistenceDelegate,  java.beans.AwtComponentPersistenceDelegate,  java.beans.AwtMenuPersistenceDelegate,
DefaultPersistenceDelegate
public class DefaultPersistenceDelegate extends PersistenceDelegate (Code)
Default PersistenceDelegate for normal classes. The instances of this class are used when other customized PersistenceDelegate is not set in the encoders for a particular type.

This PersistenceDelegate assumes that the bean to be made persistent has a default constructor that takes no parameters or a constructor that takes some properties as its parameters. Only the properties that can be got or set based on the knowledge gained through an introspection will be made persistent. In the case that a bean is constructed with some properties, the value of these properties should be available via the conventional getter method.


See Also:   Encoder



Constructor Summary
public  DefaultPersistenceDelegate()
     Constructs a DefaultPersistenceDelegate instance that supports the persistence of a bean which has a default constructor.
public  DefaultPersistenceDelegate(String[] propertyNames)
     Constructs a DefaultPersistenceDelegate instance that supports the persistence of a bean which is constructed with some properties.

Method Summary
protected  voidinitialize(Class type, Object oldInstance, Object newInstance, Encoder enc)
     Initializes the new instance in the new environment so that it becomes equivalent with the old one, meanwhile recording this process in the encoder.

This is done by inspecting each property of the bean.

protected  Expressioninstantiate(Object oldInstance, Encoder enc)
     Returns an expression that represents a call to the bean's constructor.
protected  booleanmutatesTo(Object o1, Object o2)
     Determines whether one object mutates to the other object.


Constructor Detail
DefaultPersistenceDelegate
public DefaultPersistenceDelegate()(Code)
Constructs a DefaultPersistenceDelegate instance that supports the persistence of a bean which has a default constructor.



DefaultPersistenceDelegate
public DefaultPersistenceDelegate(String[] propertyNames)(Code)
Constructs a DefaultPersistenceDelegate instance that supports the persistence of a bean which is constructed with some properties.
Parameters:
  propertyNames - the name of the properties that are taken as parameters by thebean's constructor




Method Detail
initialize
protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder enc)(Code)
Initializes the new instance in the new environment so that it becomes equivalent with the old one, meanwhile recording this process in the encoder.

This is done by inspecting each property of the bean. The property value from the old bean instance and the value from the new bean instance are both retrieved and examined to see whether the latter mutates to the former, and if not, issue a call to the write method to set the equivalent value for the new instance. Exceptions occured during this process are reported to the exception listener of the encoder.


Parameters:
  type - the type of the bean
Parameters:
  oldInstance - the original bean object to be recorded
Parameters:
  newInstance - the simmulating new bean object to be initialized
Parameters:
  enc - the encoder to write the outputs to



instantiate
protected Expression instantiate(Object oldInstance, Encoder enc)(Code)
Returns an expression that represents a call to the bean's constructor. The constructor may take zero or more parameters, as specified when this DefaultPersistenceDelegate is constructed.
Parameters:
  oldInstance - the old instance
Parameters:
  enc - the encoder that wants to record the old instance an expression for instantiating an object of the same type as theold instance



mutatesTo
protected boolean mutatesTo(Object o1, Object o2)(Code)
Determines whether one object mutates to the other object. If this DefaultPersistenceDelegate is constructed with one or more property names, and the class of o1 overrides the "equals(Object)" method, then o2 is considered to mutate to o1 if o1 equals to o2. Otherwise, the result is the same as the definition in PersistenceDelegate.
Parameters:
  o1 - one object
Parameters:
  o2 - the other object true if second object mutates to the first object, otherwisefalse



Methods inherited from java.beans.PersistenceDelegate
protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder enc)(Code)(Java Doc)
abstract protected Expression instantiate(Object oldInstance, Encoder enc)(Code)(Java Doc)
protected boolean mutatesTo(Object o1, Object o2)(Code)(Java Doc)
public void writeObject(Object oldInstance, Encoder out)(Code)(Java Doc)

Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) 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.