Author: simoneg
Date: Tue Jun  7 17:22:38 2011
New Revision: 1133103

URL: http://svn.apache.org/viewvc?rev=1133103&view=rev
Log:
(Even) better access to underlying property, with easier support for ITDs and 
other aspects

Modified:
    
labs/magma/trunk/foundation-beans/src/main/java/org/apache/magma/beans/PropertyInfo.java

Modified: 
labs/magma/trunk/foundation-beans/src/main/java/org/apache/magma/beans/PropertyInfo.java
URL: 
http://svn.apache.org/viewvc/labs/magma/trunk/foundation-beans/src/main/java/org/apache/magma/beans/PropertyInfo.java?rev=1133103&r1=1133102&r2=1133103&view=diff
==============================================================================
--- 
labs/magma/trunk/foundation-beans/src/main/java/org/apache/magma/beans/PropertyInfo.java
 (original)
+++ 
labs/magma/trunk/foundation-beans/src/main/java/org/apache/magma/beans/PropertyInfo.java
 Tue Jun  7 17:22:38 2011
@@ -200,9 +200,6 @@ public class PropertyInfo implements Clo
                return this.isEnum;
        }
 
-       public void init(PropertyDescriptor descriptor, Class beanClass) {
-               this.init(descriptor, beanClass, false);
-       }
        /**
         * Initializes this class, parsing the {@link PropertyDescriptor} and 
eventually annotations found on the getter or setter methods.
         * 
@@ -212,8 +209,7 @@ public class PropertyInfo implements Clo
         * @param beanClass the class of the bean containing the property.
         */
        @SuppressWarnings("unchecked")
-       public void init(PropertyDescriptor descriptor, Class beanClass, 
boolean underlying) {
-               this.isUnderlying = underlying;
+       public void init(PropertyDescriptor descriptor, Class beanClass) {
                this.descriptor = descriptor;
                this.beanClass = beanClass;
                this.name = descriptor.getName();
@@ -223,7 +219,7 @@ public class PropertyInfo implements Clo
                Consider consider = null;
                if (readMethod != null) consider = 
readMethod.getAnnotation(Consider.class);
                if (consider == null && writeMethod != null) consider = 
writeMethod.getAnnotation(Consider.class);
-               if (consider != null && !underlying) {
+               if (consider != null && !this.isUnderlying) {
                        this.underlyingType = descriptor.getPropertyType();     
                
                        this.type = consider.value();
                        this.underlyingConverter = 
Converters.getConverterFor(this.type, this.underlyingType);
@@ -257,7 +253,7 @@ public class PropertyInfo implements Clo
                this.readable = readMethod != null;
                this.writeable = writeMethod != null;
                this.underlyingWriteable = this.writeable;
-               if (!underlying) {
+               if (!isUnderlying) {
                        if ((readMethod != null && 
readMethod.isAnnotationPresent(MagReadOnly.class)) || 
                                        (writeMethod != null && 
writeMethod.isAnnotationPresent(MagReadOnly.class)) ||
                                        
beanClass.isAnnotationPresent(MagReadOnly.class)) {
@@ -303,7 +299,8 @@ public class PropertyInfo implements Clo
        }
        
        protected void initAsUnderlying(PropertyInfo sup) {
-               this.init(sup.descriptor, sup.beanClass, true);
+               this.isUnderlying = true;
+               this.init(sup.descriptor, sup.beanClass);
        }
        
        /**



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to