You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ge...@apache.org on 2001/11/19 14:53:09 UTC
cvs commit: jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node ASTIdentifier.java
geirm 01/11/19 05:53:09
Modified: src/java/org/apache/velocity/runtime/parser/node
ASTIdentifier.java
Log:
Added BooleanPropertyExecutor after GetExecutor to support isProperty()
accessors in proper order
Revision Changes Path
1.16 +18 -8 jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTIdentifier.java
Index: ASTIdentifier.java
===================================================================
RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTIdentifier.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ASTIdentifier.java 2001/10/22 03:53:24 1.15
+++ ASTIdentifier.java 2001/11/19 13:53:08 1.16
@@ -80,7 +80,7 @@
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: ASTIdentifier.java,v 1.15 2001/10/22 03:53:24 jon Exp $
+ * @version $Id: ASTIdentifier.java,v 1.16 2001/11/19 13:53:08 geirm Exp $
*/
public class ASTIdentifier extends SimpleNode
{
@@ -127,23 +127,33 @@
private AbstractExecutor doIntrospection( Class data )
throws Exception
{
+ AbstractExecutor executor;
+
/*
- * We are now going to allow a get(key) method
- * to be used on objects that don't implement
- * the Map interface. That was a silly restriction,
- * I just ran into it so it's silly ;-)
- *
+ * first try for a getFoo() type of property
+ * (also getfoo() )
*/
-
- AbstractExecutor executor;
executor = new PropertyExecutor(rsvc, data, identifier);
+ /*
+ * if that didn't work, look for get("foo")
+ */
+
if (executor.isAlive() == false)
{
executor = new GetExecutor( rsvc, data, identifier);
}
+ /*
+ * finally, look for boolean isFoo()
+ */
+
+ if( executor.isAlive() == false)
+ {
+ executor = new BooleanPropertyExecutor( rsvc, data, identifier );
+ }
+
return executor;
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>