You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ra...@apache.org on 2006/04/27 08:50:37 UTC
svn commit: r397447 -
/jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/BooleanPropertyExecutor.java
Author: rahul
Date: Wed Apr 26 23:50:37 2006
New Revision: 397447
URL: http://svn.apache.org/viewcvs?rev=397447&view=rev
Log:
Conform to checkstyle, add missing Javadocs. No functional change.
Modified:
jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/BooleanPropertyExecutor.java
Modified: jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/BooleanPropertyExecutor.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/BooleanPropertyExecutor.java?rev=397447&r1=397446&r2=397447&view=diff
==============================================================================
--- jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/BooleanPropertyExecutor.java (original)
+++ jakarta/commons/proper/jexl/trunk/src/java/org/apache/commons/jexl/util/BooleanPropertyExecutor.java Wed Apr 26 23:50:37 2006
@@ -20,32 +20,45 @@
/**
* Handles discovery and valuation of a
* boolean object property, of the
- * form public boolean is<property> when executed.
+ * form public boolean is<Property> when executed.
*
* We do this separately as to preserve the current
- * quasi-broken semantics of get<as is property>
- * get< flip 1st char> get("property") and now followed
- * by is<Property>
+ * quasi-broken semantics of get <as is property>
+ * get<flip 1st char> get("property") and now followed
+ * by is<Property>.
*
* @since 1.0
* @author <a href="geirm@apache.org">Geir Magnusson Jr.</a>
* @version $Id$
*/
-public class BooleanPropertyExecutor extends PropertyExecutor
-{
- public BooleanPropertyExecutor(Log rlog, org.apache.commons.jexl.util.introspection.Introspector is, Class clazz, String property)
- {
- super(rlog, is, clazz, property);
+public class BooleanPropertyExecutor extends PropertyExecutor {
+
+ /**
+ * Constructor.
+ *
+ * @param rlog The instance log.
+ * @param is The JEXL introspector.
+ * @param clazz The class being analyzed.
+ * @param property The boolean property.
+ */
+ public BooleanPropertyExecutor(Log rlog,
+ org.apache.commons.jexl.util.introspection.Introspector is,
+ Class clazz, String property) {
+ super(rlog, is, clazz, property);
}
- protected void discover(Class clazz, String property)
- {
- try
- {
+ /**
+ * Locate the getter method for this boolean property.
+ *
+ * @param clazz The class being analyzed.
+ * @param property Name of boolean property.
+ */
+ protected void discover(Class clazz, String property) {
+ try {
char c;
StringBuffer sb;
- Object[] params = { };
+ Object[] params = {};
/*
* now look for a boolean isFoo
@@ -56,28 +69,25 @@
c = sb.charAt(2);
- if (Character.isLowerCase(c))
- {
+ if (Character.isLowerCase(c)) {
sb.setCharAt(2, Character.toUpperCase(c));
}
methodUsed = sb.toString();
method = introspector.getMethod(clazz, methodUsed, params);
- if (method != null)
- {
+ if (method != null) {
/*
* now, this has to return a boolean
*/
- if (method.getReturnType() == Boolean.TYPE)
+ if (method.getReturnType() == Boolean.TYPE) {
return;
+ }
method = null;
}
- }
- catch(Exception e)
- {
+ } catch (Exception e) {
rlog.error("PROGRAMMER ERROR : BooleanPropertyExector() : " + e);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org