Java Doc for MethodProperty.java in  » Web-Framework » Millstone » org » millstone » base » data » util » 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 » Web Framework » Millstone » org.millstone.base.data.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.millstone.base.data.util.MethodProperty

MethodProperty
public class MethodProperty implements Property(Code)

Proxy class for creating Properties from pairs of getter and setter methods of a Bean property. An instance of this class can be thought as having been attached to a field of an object. Accessing the object through the Property interface directly manipulates the underlying field.

It's assumed that the return value returned by the getter method is assignable to the type of the property, and the setter method parameter is assignable to that value.

A valid getter method must always be available, but instance of this class can be constructed with a null setter method in which case the resulting MethodProperty is read-only.


author:
   IT Mill Ltd.
version:
   3.1.1
since:
   3.0

Inner Class :public class MethodException extends RuntimeException


Constructor Summary
public  MethodProperty(Object instance, String beanPropertyName)
    

Creates a new instance of MethodProperty from a named bean property.

public  MethodProperty(Class type, Object instance, String getMethodName, String setMethodName)
    

Creates a new instance of MethodProperty from named getter and setter methods.

public  MethodProperty(Class type, Object instance, Method getMethod, Method setMethod)
    

Creates a new instance of MethodProperty with the getter and setter methods.

public  MethodProperty(Class type, Object instance, String getMethodName, String setMethodName, Object[] getArgs, Object[] setArgs, int setArgumentIndex)
    

Creates a new instance of MethodProperty from named getter and setter methods and argument lists.

public  MethodProperty(Class type, Object instance, Method getMethod, Method setMethod, Object[] getArgs, Object[] setArgs, int setArgumentIndex)
    

Creates a new instance of MethodProperty from the getter and setter methods, and argument lists.


Method Summary
public  voidaddListener(Property.ReadOnlyStatusChangeListener listener)
     Registers a new read-only status change listener for this Property.
final public  ClassgetType()
     Returns the type of the Property.
public  ObjectgetValue()
     Gets the value stored in the Property.
public  booleanisReadOnly()
     Tests if the object is in read-only mode.
public  voidremoveListener(Property.ReadOnlyStatusChangeListener listener)
     Remove a previously registered read-only status change listener.
public  voidsetArguments(Object[] getArgs, Object[] setArgs, int setArgumentIndex)
    
public  voidsetReadOnly(boolean newStatus)
     Sets the Property's read-only mode to the specified status.
public  voidsetValue(Object newValue)
     Set the value of the property.
public  StringtoString()
     Returns the value of the MethodProperty in human readable textual format.


Constructor Detail
MethodProperty
public MethodProperty(Object instance, String beanPropertyName)(Code)

Creates a new instance of MethodProperty from a named bean property. This constructor takes an object and the name of a bean property and initializes itself with the accessor methods for the property. The getter method of a MethodProperty instantiated with this constructor will be called with no arguments, and the setter method with only the new value as the sole argument.

If the setter method is unavailable, the resulting MethodProperty will be read-only, otherwise it will be read-write.

Method names are constucted from the bean property by adding get/is/are/set prefix and capitalising the first character in the name of the given bean property


Parameters:
  instance - object that includes the property
Parameters:
  beanPropertyName - name of the property to bind to



MethodProperty
public MethodProperty(Class type, Object instance, String getMethodName, String setMethodName)(Code)

Creates a new instance of MethodProperty from named getter and setter methods. The getter method of a MethodProperty instantiated with this constructor will be called with no arguments, and the setter method with only the new value as the sole argument.

If the setter method is null, the resulting MethodProperty will be read-only, otherwise it will be read-write.


Parameters:
  type - type of the property
Parameters:
  instance - object that includes the property
Parameters:
  getMethodName - name of the getter method
Parameters:
  setMethodName - name of the setter method



MethodProperty
public MethodProperty(Class type, Object instance, Method getMethod, Method setMethod)(Code)

Creates a new instance of MethodProperty with the getter and setter methods. The getter method of a MethodProperty instantiated with this constructor will be called with no arguments, and the setter method with only the new value as the sole argument.

If the setter method is null, the resulting MethodProperty will be read-only, otherwise it will be read-write.


Parameters:
  type - type of the property
Parameters:
  instance - object that includes the property
Parameters:
  getMethod - the getter method
Parameters:
  setMethod - the setter method



MethodProperty
public MethodProperty(Class type, Object instance, String getMethodName, String setMethodName, Object[] getArgs, Object[] setArgs, int setArgumentIndex)(Code)

Creates a new instance of MethodProperty from named getter and setter methods and argument lists. The getter method of a MethodProperty instantiated with this constructor will be called with getArgs as arguments. setArgs will be used as the arguments for the setter method, though the argument indexed by setArgumentIndex will be replaced with the argument passed to the MethodProperty.setValue(Object newValue) method.

For example, if the setArgs contains A, B and C, and setArgumentIndex = 1, the call methodProperty.setValue(X) would result in the setter method to be called with the parameter set of {A, X, C}


Parameters:
  type - type of the property
Parameters:
  instance - object that includes the property
Parameters:
  getMethodName - the name of the getter method
Parameters:
  setMethodName - the name of the setter method
Parameters:
  getArgs - fixed argument list to be passed to the getter method
Parameters:
  setArgs - fixed argument list to be passed to the setter method
Parameters:
  setArgumentIndex - the index of the argument insetArgs to be replaced with newValue whenMethodProperty.setValue(Object newValue) is called



MethodProperty
public MethodProperty(Class type, Object instance, Method getMethod, Method setMethod, Object[] getArgs, Object[] setArgs, int setArgumentIndex)(Code)

Creates a new instance of MethodProperty from the getter and setter methods, and argument lists. This constructor behaves exctly like MethodProperty.MethodProperty(Class type,Object instance,String getMethodName,String setMethodName,Object[] getArgs,Object[] setArgs,int setArgumentIndex) except that instead of names of the getter and setter methods this constructor is given the actual methods themselves.


Parameters:
  type - type of the property
Parameters:
  instance - object that includes the property
Parameters:
  getMethod - the getter method
Parameters:
  setMethod - the setter method
Parameters:
  getArgs - fixed argument list to be passed to the getter method
Parameters:
  setArgs - fixed argument list to be passed to the setter method
Parameters:
  setArgumentIndex - the index of the argument insetArgs to be replaced with newValue whenMethodProperty.setValue(Object newValue) is called




Method Detail
addListener
public void addListener(Property.ReadOnlyStatusChangeListener listener)(Code)
Registers a new read-only status change listener for this Property.
Parameters:
  listener - the new Listener to be registered



getType
final public Class getType()(Code)
Returns the type of the Property. The methods getValue and setValue must be compatible with this type: one must be able to safely cast the value returned from getValue to the given type and pass any variable assignable to this type as an argument to setValue. type of the Property



getValue
public Object getValue()(Code)
Gets the value stored in the Property. The value is resolved by calling the specified getter method with the argument specified at instantiation. the value of the Property



isReadOnly
public boolean isReadOnly()(Code)
Tests if the object is in read-only mode. In read-only mode calls to setValue will throw ReadOnlyExceptions and will not modify the value of the Property. true if the object is in read-only mode,false if it's not



removeListener
public void removeListener(Property.ReadOnlyStatusChangeListener listener)(Code)
Remove a previously registered read-only status change listener.
Parameters:
  listener - listener to be removed



setArguments
public void setArguments(Object[] getArgs, Object[] setArgs, int setArgumentIndex)(Code)

Sets the setter method and getter method argument lists.


Parameters:
  getArgs - fixed argument list to be passed to the getter method
Parameters:
  setArgs - fixed argument list to be passed to the setter method
Parameters:
  setArgumentIndex - the index of the argument insetArgs to be replaced with newValue whenMethodProperty.setValue(Object newValue) is called



setReadOnly
public void setReadOnly(boolean newStatus)(Code)
Sets the Property's read-only mode to the specified status.
Parameters:
  newStatus - new read-only status of the Property



setValue
public void setValue(Object newValue) throws Property.ReadOnlyException, Property.ConversionException(Code)
Set the value of the property. This method supports setting from Strings if either String is directly assignable to property type, or the type class contains a string constructor.
Parameters:
  newValue - New value of the property. Property.ReadOnlyException if the object is inread-only mode Property.ConversionException ifnewValue can't be converted into the Property's nativetype directly or through String



toString
public String toString()(Code)
Returns the value of the MethodProperty in human readable textual format. The return value should be assignable to the setValue method if the Property is not in read-only mode. String representation of the value stored in the Property



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.