checkstyle
[utils] / system / general / src / main / java / org / wamblee / system / adapters / SetterConfiguration.java
index d66d7636b5445c337aa0b198629186824e2d559e..c8baeafb9dcdef0e4b117d49d783c43564712613 100644 (file)
@@ -51,7 +51,7 @@ import java.util.Set;
  * @author Erik Brakkee
  */
 public class SetterConfiguration {
-    private Class _class;
+    private Class clazz;
 
     private boolean publicOnly;
 
@@ -64,7 +64,7 @@ public class SetterConfiguration {
      *            Class which is being configured.
      */
     public SetterConfiguration(Class aClass) {
-        _class = aClass;
+        clazz = aClass;
         publicOnly = true;
         setters = new HashMap<Method, ParameterValues>();
     }
@@ -76,7 +76,7 @@ public class SetterConfiguration {
     public SetterConfiguration initAllSetters() {
         setters.clear();
 
-        for (Method method : getAllSetters(_class, publicOnly)) {
+        for (Method method : getAllSetters(clazz, publicOnly)) {
             setters.put(method, createParameterValues(method));
         }
 
@@ -140,9 +140,9 @@ public class SetterConfiguration {
      * 
      */
     public SetterConfiguration remove(Method aMethod) {
-        if (!aMethod.getDeclaringClass().isAssignableFrom(_class)) {
+        if (!aMethod.getDeclaringClass().isAssignableFrom(clazz)) {
             throw new RuntimeException("Method " + aMethod +
-                " not found in class " + _class + " or its superclasses");
+                " not found in class " + clazz + " or its superclasses");
         }
 
         for (Method method : setters.keySet()) {
@@ -169,7 +169,7 @@ public class SetterConfiguration {
     public SetterConfiguration add(final String aName) {
         int oldlen = setters.size();
         List<Method> methods = new ArrayList<Method>();
-        CollectionFilter.filter(getAllSetters(_class, publicOnly), methods,
+        CollectionFilter.filter(getAllSetters(clazz, publicOnly), methods,
             new Condition<Method>() {
                 @Override
                 public boolean matches(Method aObject) {
@@ -179,7 +179,7 @@ public class SetterConfiguration {
 
         if (methods.size() == 0) {
             throw new IllegalArgumentException("Method '" + aName +
-                "' not found in " + _class.getName());
+                "' not found in " + clazz.getName());
         }
 
         // TODO is it possible to get more than one setter here in case the
@@ -205,7 +205,7 @@ public class SetterConfiguration {
      */
     public SetterConfiguration addSetter(final Class aType) {
         List<Method> result = new ArrayList<Method>();
-        CollectionFilter.filter(getAllSetters(_class, publicOnly), result,
+        CollectionFilter.filter(getAllSetters(clazz, publicOnly), result,
             new Condition<Method>() {
                 @Override
                 public boolean matches(Method aObject) {
@@ -217,7 +217,7 @@ public class SetterConfiguration {
 
         if (result.size() == 0) {
             throw new IllegalArgumentException("No setter found in class '" +
-                _class.getName() + "' that has a setter with argument type '" +
+                clazz.getName() + "' that has a setter with argument type '" +
                 aType.getName() + "'");
         }
 
@@ -229,7 +229,7 @@ public class SetterConfiguration {
             }
 
             throw new IllegalArgumentException(
-                "Multiple setters found in class '" + _class.getName() +
+                "Multiple setters found in class '" + clazz.getName() +
                     " that accept type '" + aType.getName() + "': " + setters);
         }
 
@@ -301,9 +301,9 @@ public class SetterConfiguration {
      * 
      */
     public void inject(Scope aScope, Object aObject) {
-        if (!_class.isInstance(aObject)) {
+        if (!clazz.isInstance(aObject)) {
             throw new IllegalArgumentException("Object '" + aObject +
-                "' is not an instance of " + _class.getName());
+                "' is not an instance of " + clazz.getName());
         }
 
         for (Method method : setters.keySet()) {