commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1241020 - /commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
Date Mon, 06 Feb 2012 14:30:47 GMT
Author: simonetripodi
Date: Mon Feb  6 14:30:46 2012
New Revision: 1241020

URL: http://svn.apache.org/viewvc?rev=1241020&view=rev
Log:
started managing indexed properties

Modified:
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java?rev=1241020&r1=1241019&r2=1241020&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/PropertyDescriptorsRegistry.java
Mon Feb  6 14:30:46 2012
@@ -22,6 +22,7 @@ package org.apache.commons.beanutils2;
 import static java.beans.Introspector.getBeanInfo;
 
 import java.beans.BeanInfo;
+import java.beans.IndexedPropertyDescriptor;
 import java.beans.IntrospectionException;
 import java.beans.PropertyDescriptor;
 import java.lang.ref.Reference;
@@ -108,6 +109,32 @@ final class PropertyDescriptorsRegistry
             writeMethod = methodsRegistry.get( true, beanType, writeMethod.getName(), writeMethod.getParameterTypes()
);
             propertyDescriptor.setWriteMethod( writeMethod );
         }
+
+        // indexed property
+
+        if ( propertyDescriptor instanceof IndexedPropertyDescriptor )
+        {
+            IndexedPropertyDescriptor indexedPropertyDescriptor = (IndexedPropertyDescriptor)
propertyDescriptor;
+
+            if ( indexedPropertyDescriptor.getIndexedReadMethod() != null )
+            {
+                Method indexedReadMethod = indexedPropertyDescriptor.getIndexedReadMethod();
+                indexedReadMethod = methodsRegistry.get( true,
+                                                         beanType,
+                                                         indexedReadMethod.getName(),
+                                                         indexedReadMethod.getParameterTypes()
);
+                indexedPropertyDescriptor.setIndexedReadMethod( indexedReadMethod );
+            }
+            if ( indexedPropertyDescriptor.getIndexedWriteMethod() != null )
+            {
+                Method indexedWriteMethod = indexedPropertyDescriptor.getIndexedWriteMethod();
+                indexedWriteMethod = methodsRegistry.get( true,
+                                                          beanType,
+                                                          indexedWriteMethod.getName(),
+                                                          indexedWriteMethod.getParameterTypes()
);
+                indexedPropertyDescriptor.setIndexedWriteMethod( indexedWriteMethod );
+            }
+        }
     }
 
     public PropertyDescriptor getPropertyDescriptor( Class<?> beanType, String propertyName
)



Mime
View raw message