IntrospectorBase (Commons JEXL 2.0.1 API)
Keywords: org.apache.commons.jexl2.internal.introspection.IntrospectorBase class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.jexl2.internal.introspection
Class IntrospectorBase

    java.lang.Object
      org.apache.commons.jexl2.internal.introspection.IntrospectorBase

    public class IntrospectorBase

extends java.lang.Object

This basic function of this class is to return a Method object for a particular class given the name of a method and the parameters to the method in the form of an Object[]

The first time the Introspector sees a class it creates a class method map for the class in question. Basically the class method map is a Hastable where Method objects are keyed by a concatenation of the method name and the names of classes that make up the parameters. For example, a method with the following signature: public void method(String a, StringBuffer b) would be mapped by the key: "method" + "java.lang.String" + "java.lang.StringBuffer" This mapping is performed for all the methods in a class and stored for

Since:
  1.0
Version:
  $Id: IntrospectorBase.java 896952 2010-01-07 18:21:29Z henrib $
Author:
  Jason van Zyl, Bob McWhirter, Attila Szegedi, Paulo Gaspar, Henning P. Schmiedehausen

Field Summary
`protected org.apache.commons.logging.Log` | `rlog` the logger.

Constructor Summary
`IntrospectorBase(org.apache.commons.logging.Log log)` Create the introspector.

Method Summary
`java.lang.reflect.Constructor<?>` | `getConstructor(java.lang.Class<?> c, MethodKey key)` Gets the constructor defined by the `MethodKey`.
`java.lang.reflect.Constructor<?>` | `getConstructor(MethodKey key)` Gets the constructor defined by the `MethodKey`.
`java.lang.reflect.Field` | `getField(java.lang.Class<?> c, java.lang.String key)` Gets the field named by `key` for the class `c`.
`java.lang.String[]` | `getFieldNames(java.lang.Class<?> c)` Gets the array of accessible field names known for a given class.
`java.lang.reflect.Method` | `getMethod(java.lang.Class<?> c, MethodKey key)` Gets the method defined by the `MethodKey` for the class `c`.
`java.lang.String[]` | `getMethodNames(java.lang.Class<?> c)` Gets the array of accessible methods names known for a given class.
`void` | `setLoader(java.lang.ClassLoader cloader)` Sets the class loader used to solve constructors.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### rlog

    protected final org.apache.commons.logging.Log rlog

  the logger.

Constructor Detail

### IntrospectorBase

    public IntrospectorBase(org.apache.commons.logging.Log log)

  Create the introspector.

  Parameters:
    `log` - the logger to use

Method Detail

### getMethod

    public java.lang.reflect.Method getMethod(java.lang.Class<?> c,
                                              MethodKey key)

  Gets the method defined by the `MethodKey` for the class `c`.

  Parameters:
    `c` - Class in which the method search is taking place
    `key` - Key of the method being searched for
  Returns:
    The desired Method object.
  Throws:
    `java.lang.IllegalArgumentException` - When the parameters passed in can not be used for introspection.

### getField

    public java.lang.reflect.Field getField(java.lang.Class<?> c,
                                            java.lang.String key)

  Gets the field named by `key` for the class `c`.

  Parameters:
    `c` - Class in which the field search is taking place
    `key` - Name of the field being searched for
  Returns:
    the desired field or null if it does not exist or is not accessible

### getFieldNames

    public java.lang.String[] getFieldNames(java.lang.Class<?> c)

  Gets the array of accessible field names known for a given class.

  Parameters:
    `c` - the class
  Returns:
    the class field names

### getMethodNames

    public java.lang.String[] getMethodNames(java.lang.Class<?> c)

  Gets the array of accessible methods names known for a given class.

  Parameters:
    `c` - the class
  Returns:
    the class method names

### setLoader

    public void setLoader(java.lang.ClassLoader cloader)

  Sets the class loader used to solve constructors.

  Also cleans the constructors cache.

  Parameters:
    `cloader` - the class loader; if null, use this instance class loader

### getConstructor

    public java.lang.reflect.Constructor<?> getConstructor(MethodKey key)

  Gets the constructor defined by the `MethodKey`.

  Parameters:
    `key` - Key of the constructor being searched for
  Returns:
    The desired Constructor object.
  Throws:
    `java.lang.IllegalArgumentException` - When the parameters passed in can not be used for introspection.

### getConstructor

    public java.lang.reflect.Constructor<?> getConstructor(java.lang.Class<?> c,
                                                           MethodKey key)

  Gets the constructor defined by the `MethodKey`.

  Parameters:
    `c` - the class we want to instantiate
    `key` - Key of the constructor being searched for
  Returns:
    The desired Constructor object.
  Throws:
    `java.lang.IllegalArgumentException` - When the parameters passed in can not be used for introspection.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.