View Javadoc

1   /*
2    * Copyright 2002,2004 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.commons.jexl.util.introspection;
18  
19  /***
20   * Method used for regular method invocation.
21   * 
22   * $foo.bar()
23   * 
24   * 
25   * @since 1.0
26   * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
27   * @version $Id: VelMethod.java 398513 2006-05-01 03:42:52Z dion $
28   */
29  public interface VelMethod {
30      /***
31       * invocation method - called when the method invocation should be performed
32       * and a value returned.
33  
34       * @param o the object
35       * @param params method parameters.
36       * @return the result
37       * @throws Exception on any error.
38       */
39      Object invoke(Object o, Object[] params) throws Exception;
40  
41      /***
42       * specifies if this VelMethod is cacheable and able to be reused for this
43       * class of object it was returned for.
44       * 
45       * @return true if can be reused for this class, false if not
46       */
47      boolean isCacheable();
48  
49      /***
50       * Gets the method name used.
51       * @return method name
52       */
53      String getMethodName();
54  
55      /***
56       * returns the return type of the method invoked.
57       * @return return type
58       */
59      Class getReturnType();
60  }