commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1142254 - in /commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3: ./ annotations/utils/ plugins/strategies/ xmlrules/
Date Sat, 02 Jul 2011 18:20:14 GMT
Author: simonetripodi
Date: Sat Jul  2 18:20:14 2011
New Revision: 1142254

URL: http://svn.apache.org/viewvc?rev=1142254&view=rev
Log:
BeanUtils static methods imported in static way

Modified:
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertiesRule.java
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertyRule.java
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/plugins/strategies/LoaderFromClass.java
    commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/xmlrules/ObjectParamRule.java

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java?rev=1142254&r1=1142253&r2=1142254&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetNestedPropertiesRule.java
Sat Jul  2 18:20:14 2011
@@ -19,6 +19,9 @@ package org.apache.commons.digester3;
  * under the License.
  */
 
+import static org.apache.commons.beanutils.BeanUtils.setProperty;
+import static org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor;
+
 import static java.lang.String.format;
 
 import java.beans.PropertyDescriptor;
@@ -28,10 +31,8 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.commons.beanutils.DynaProperty;
-import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.logging.Log;
 import org.xml.sax.Attributes;
 
@@ -506,7 +507,7 @@ public class SetNestedPropertiesRule
                 else
                 /* this is a standard JavaBean */
                 {
-                    PropertyDescriptor desc = PropertyUtils.getPropertyDescriptor( top, propName
);
+                    PropertyDescriptor desc = getPropertyDescriptor( top, propName );
                     if ( desc == null )
                     {
                         throw new NoSuchMethodException( "Bean has no property named " +
propName );
@@ -516,7 +517,7 @@ public class SetNestedPropertiesRule
 
             try
             {
-                BeanUtils.setProperty( top, propName, text );
+                setProperty( top, propName, text );
             }
             catch ( NullPointerException e )
             {

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertiesRule.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertiesRule.java?rev=1142254&r1=1142253&r2=1142254&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertiesRule.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertiesRule.java
Sat Jul  2 18:20:14 2011
@@ -19,13 +19,13 @@ package org.apache.commons.digester3;
  * under the License.
  */
 
+import static org.apache.commons.beanutils.BeanUtils.*;
+import static org.apache.commons.beanutils.PropertyUtils.*;
 import static java.lang.String.format;
 
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.commons.beanutils.BeanUtils;
-import org.apache.commons.beanutils.PropertyUtils;
 import org.xml.sax.Attributes;
 
 /**
@@ -200,7 +200,7 @@ public class SetPropertiesRule
                 // compatible so we'll accept the risk here.
 
                 Object top = getDigester().peek();
-                boolean test = PropertyUtils.isWriteable( top, attributeName );
+                boolean test = isWriteable( top, attributeName );
                 if ( !test )
                 {
                     throw new NoSuchMethodException( "Property " + attributeName + " can't
be set" );
@@ -229,7 +229,7 @@ public class SetPropertiesRule
                                                          getDigester().getMatch() ) );
             }
         }
-        BeanUtils.populate( top, values );
+        populate( top, values );
     }
 
     /**

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertyRule.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertyRule.java?rev=1142254&r1=1142253&r2=1142254&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertyRule.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/SetPropertyRule.java
Sat Jul  2 18:20:14 2011
@@ -20,13 +20,13 @@ package org.apache.commons.digester3;
  */
 
 import static java.lang.String.format;
+import static org.apache.commons.beanutils.BeanUtils.setProperty;
+import static org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor;
 
 import java.beans.PropertyDescriptor;
 
-import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.commons.beanutils.DynaProperty;
-import org.apache.commons.beanutils.PropertyUtils;
 import org.xml.sax.Attributes;
 
 /**
@@ -127,7 +127,7 @@ public class SetPropertyRule
         else
         /* this is a standard JavaBean */
         {
-            PropertyDescriptor desc = PropertyUtils.getPropertyDescriptor( top, actualName
);
+            PropertyDescriptor desc = getPropertyDescriptor( top, actualName );
             if ( desc == null )
             {
                 throw new NoSuchMethodException( "Bean has no property named " + actualName
);
@@ -135,7 +135,7 @@ public class SetPropertyRule
         }
 
         // Set the property (with conversion as necessary)
-        BeanUtils.setProperty( top, actualName, actualValue );
+        setProperty( top, actualName, actualValue );
     }
 
     /**

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java?rev=1142254&r1=1142253&r2=1142254&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java
Sat Jul  2 18:20:14 2011
@@ -19,9 +19,9 @@ package org.apache.commons.digester3.ann
  * under the License.
  */
 
-import java.lang.annotation.Annotation;
+import static org.apache.commons.beanutils.MethodUtils.invokeExactMethod;
 
-import org.apache.commons.beanutils.MethodUtils;
+import java.lang.annotation.Annotation;
 
 /**
  * Simple utility class to introspect annotations.
@@ -146,7 +146,7 @@ public class AnnotationUtils
     {
         try
         {
-            return MethodUtils.invokeExactMethod( annotation, method, null );
+            return invokeExactMethod( annotation, method, null );
         }
         catch ( Throwable t )
         {

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/plugins/strategies/LoaderFromClass.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/plugins/strategies/LoaderFromClass.java?rev=1142254&r1=1142253&r2=1142254&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/plugins/strategies/LoaderFromClass.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/plugins/strategies/LoaderFromClass.java
Sat Jul  2 18:20:14 2011
@@ -19,13 +19,14 @@ package org.apache.commons.digester3.plu
  * under the License.
  */
 
+import static org.apache.commons.beanutils.MethodUtils.getAccessibleMethod;
+
 import java.lang.reflect.Method;
 
-import org.apache.commons.beanutils.MethodUtils;
-import org.apache.commons.logging.Log;
 import org.apache.commons.digester3.Digester;
 import org.apache.commons.digester3.plugins.PluginException;
 import org.apache.commons.digester3.plugins.RuleLoader;
+import org.apache.commons.logging.Log;
 
 /**
  * A RuleLoader which invokes a static method on a target class, leaving that method to actually
instantiate and add new
@@ -116,7 +117,7 @@ public class LoaderFromClass
         throws PluginException
     {
         Class<?>[] paramSpec = { Digester.class, String.class };
-        Method rulesMethod = MethodUtils.getAccessibleMethod( rulesClass, methodName, paramSpec
);
+        Method rulesMethod = getAccessibleMethod( rulesClass, methodName, paramSpec );
 
         return rulesMethod;
     }

Modified: commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/xmlrules/ObjectParamRule.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/xmlrules/ObjectParamRule.java?rev=1142254&r1=1142253&r2=1142254&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/xmlrules/ObjectParamRule.java
(original)
+++ commons/proper/digester/trunk/src/main/java/org/apache/commons/digester3/xmlrules/ObjectParamRule.java
Sat Jul  2 18:20:14 2011
@@ -19,7 +19,8 @@ package org.apache.commons.digester3.xml
  * under the License.
  */
 
-import org.apache.commons.beanutils.ConvertUtils;
+import static org.apache.commons.beanutils.ConvertUtils.convert;
+
 import org.apache.commons.digester3.binder.LinkedRuleBuilder;
 import org.apache.commons.digester3.binder.ObjectParamBuilder;
 import org.apache.commons.digester3.binder.RulesBinder;
@@ -66,7 +67,7 @@ final class ObjectParamRule
         }
         else
         {
-            param = ConvertUtils.convert( value, clazz );
+            param = convert( value, clazz );
         }
 
         ObjectParamBuilder<?> builder = linkedRuleBuilder.objectParam( param ).ofIndex(
paramIndex );



Mime
View raw message