You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2006/04/26 06:07:55 UTC
svn commit: r397078 - in /jakarta/commons/proper/jexl/trunk/examples:
ArrayExample.java MethodPropertyExample.java
Author: dion
Date: Tue Apr 25 21:07:54 2006
New Revision: 397078
URL: http://svn.apache.org/viewcvs?rev=397078&view=rev
Log:
Checkstyle
Modified:
jakarta/commons/proper/jexl/trunk/examples/ArrayExample.java
jakarta/commons/proper/jexl/trunk/examples/MethodPropertyExample.java
Modified: jakarta/commons/proper/jexl/trunk/examples/ArrayExample.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jexl/trunk/examples/ArrayExample.java?rev=397078&r1=397077&r2=397078&view=diff
==============================================================================
--- jakarta/commons/proper/jexl/trunk/examples/ArrayExample.java (original)
+++ jakarta/commons/proper/jexl/trunk/examples/ArrayExample.java Tue Apr 25 21:07:54 2006
@@ -1,12 +1,12 @@
/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
+ * Copyright 2002-2006 The Apache Software Foundation.
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,17 +23,19 @@
import java.util.ArrayList;
/**
- * simple example to show how to access arrays
+ * Simple example to show how to access arrays.
*
* @since 1.0
* @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
* @version $Id$
*/
-public class ArrayExample
-{
- public static void main(String args[])
- throws Exception
- {
+public class ArrayExample {
+ /**
+ * Command line entry point.
+ * @param args command line arguments
+ * @throws Exception cos jexl does.
+ */
+ public static void main(String[] args) throws Exception {
/*
* First make a jexlContext and put stuff in it
*/
Modified: jakarta/commons/proper/jexl/trunk/examples/MethodPropertyExample.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jexl/trunk/examples/MethodPropertyExample.java?rev=397078&r1=397077&r2=397078&view=diff
==============================================================================
--- jakarta/commons/proper/jexl/trunk/examples/MethodPropertyExample.java (original)
+++ jakarta/commons/proper/jexl/trunk/examples/MethodPropertyExample.java Tue Apr 25 21:07:54 2006
@@ -1,12 +1,12 @@
/*
- * Copyright 2002,2004 The Apache Software Foundation.
- *
+ * Copyright 2002-2006 The Apache Software Foundation.
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,17 +20,19 @@
import org.apache.commons.jexl.ExpressionFactory;
/**
- * simple example to show how to access method and properties
+ * Simple example to show how to access method and properties.
*
* @since 1.0
* @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
* @version $Id$
*/
-public class MethodPropertyExample
-{
- public static void main(String args[])
- throws Exception
- {
+public class MethodPropertyExample {
+ /**
+ * Command line entry point.
+ * @param args Command line arguments
+ * @throws Exception on any error.
+ */
+ public static void main(String[] args) throws Exception {
/*
* First make a jexlContext and put stuff in it
*/
@@ -51,15 +53,15 @@
*/
e = ExpressionFactory.createExpression("foo.convert(1)");
o = e.evaluate(jc);
- System.out.println("value returned by the method convert() w/ arg = 1 is : " + o);
+ System.out.println("value of " + e.getExpression() + " is : " + o);
e = ExpressionFactory.createExpression("foo.convert(1+7)");
o = e.evaluate(jc);
- System.out.println("value returned by the method convert() w/ arg = 1+7 is : " + o);
+ System.out.println("value of " + e.getExpression() + " is : " + o);
e = ExpressionFactory.createExpression("foo.convert(1+number)");
o = e.evaluate(jc);
- System.out.println("value returned by the method convert() w/ arg = 1+number is : " + o);
+ System.out.println("value of " + e.getExpression() + " is : " + o);
/*
* access a property
@@ -70,20 +72,33 @@
}
- public static class Foo
- {
- public String getFoo()
- {
+ /**
+ * Helper example class.
+ */
+ public static class Foo {
+ /**
+ * Gets foo.
+ * @return a string.
+ */
+ public String getFoo() {
return "This is from getFoo()";
}
- public String get(String arg)
- {
+ /**
+ * Gets an arbitrary property.
+ * @param arg property name.
+ * @return arg prefixed with 'This is the property '.
+ */
+ public String get(String arg) {
return "This is the property " + arg;
}
- public String convert(long i)
- {
+ /**
+ * Gets a string from the argument.
+ * @param i a long.
+ * @return The argument prefixed with 'The value is : '
+ */
+ public String convert(long i) {
return "The value is : " + i;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org