• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.apache.velocity.util.introspection;
2 
3 /*
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements.  See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership.  The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License.  You may obtain a copy of the License at
11  *
12  *   http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied.  See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  */
21 
22 import java.util.Iterator;
23 
24 /**
25  * 'Federated' introspection/reflection interface to allow the introspection
26  *  behavior in Velocity to be customized.
27  *
28  * @author <a href="mailto:geirm@apache.org">Geir Magusson Jr.</a>
29  * @version $Id$
30  */
31 public interface Uberspect
32 {
33     /**
34      *  Initializer - will be called before use
35      */
init()36     void init();
37 
38     /**
39      *  To support iteratives - #foreach()
40      * @param obj
41      * @param info
42      * @return An Iterator.
43      */
getIterator(Object obj, Info info)44     Iterator getIterator(Object obj, Info info);
45 
46     /**
47      *  Returns a general method, corresponding to $foo.bar( $woogie )
48      * @param obj
49      * @param method
50      * @param args
51      * @param info
52      * @return A Velocity Method.
53      */
getMethod(Object obj, String method, Object[] args, Info info)54     VelMethod getMethod(Object obj, String method, Object[] args, Info info);
55 
56     /**
57      * Property getter - returns VelPropertyGet appropos for #set($foo = $bar.woogie)
58      * @param obj
59      * @param identifier
60      * @param info
61      * @return A Velocity Getter.
62      */
getPropertyGet(Object obj, String identifier, Info info)63     VelPropertyGet getPropertyGet(Object obj, String identifier, Info info);
64 
65     /**
66      * Property setter - returns VelPropertySet appropos for #set($foo.bar = "geir")
67      * @param obj
68      * @param identifier
69      * @param arg
70      * @param info
71      * @return A Velocity Setter.
72      */
getPropertySet(Object obj, String identifier, Object arg, Info info)73     VelPropertySet getPropertySet(Object obj, String identifier, Object arg, Info info);
74 }
75