1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.apache.commons.jexl.util;
17  
18  import org.apache.commons.jexl.util.introspection.Uberspect;
19  import org.apache.commons.jexl.util.introspection.UberspectImpl;
20  import org.apache.commons.jexl.util.introspection.UberspectLoggable;
21  import org.apache.commons.logging.Log;
22  import org.apache.commons.logging.LogFactory;
23  
24  /***
25   *  Little class to manage a Velocity uberspector (Vel 1.4+) for instrospective
26   *  services.
27   *
28   *  @since 1.0
29   *  @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
30   *  @version $Id: Introspector.java 398171 2006-04-29 14:57:29Z dion $
31   */
32  public class Introspector {
33      /***
34       *  The uberspector from Velocity that handles all instrospection patterns.
35       */
36      private static Uberspect uberSpect;
37  
38      static {
39  
40          Log logger = LogFactory.getLog(Introspector.class);
41  
42          uberSpect = new UberspectImpl();
43          ((UberspectLoggable) uberSpect).setRuntimeLogger(logger);
44      }
45  
46      /***
47       *  For now, expose the raw uberspector to the AST.
48       *
49       *  @return Uberspect The Velocity uberspector.
50       */
51      public static Uberspect getUberspect() {
52          return uberSpect;
53      }
54  }