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
Class Introspector

    java.lang.Object
      org.apache.commons.jexl2.internal.Introspector

Direct Known Subclasses:
  UberspectImpl

    public class Introspector

extends Object

Default introspection services.

Finding methods as well as property getters & setters.

Since:
  1.0

Field Summary
`protected org.apache.commons.logging.Log` | `rlog` The logger to use for all warnings & errors.

Constructor Summary
`protected` | `Introspector(org.apache.commons.logging.Log log)` Creates an introspector.

Method Summary
`protected IntrospectorBase` | `base()` Gets the current introspector base.
`Constructor<?>` | `getConstructor(Object ctorHandle, Object[] args)` Returns a general constructor.
`protected Field` | `getField(Class<?> c, String key)` Gets the field named by `key` for the class `c`.
`String[]` | `getFieldNames(Class<?> c)` Gets the accessible field names known for a given class.
`AbstractExecutor.Get` | `getGetExecutor(Object obj, Object identifier)` Return a property getter.
`protected Method` | `getMethod(Class<?> c, MethodKey key)` Gets the method defined by `key` and for the Class `c`.
`protected Method` | `getMethod(Class<?> c, String name, Object[] params)` Gets the method defined by `name` and `params` for the Class `c`.
`AbstractExecutor.Method` | `getMethodExecutor(Object obj, String name, Object[] args)` Returns a general method.
`String[]` | `getMethodNames(Class<?> c)` Gets the accessible methods names known for a given class.
`AbstractExecutor.Set` | `getSetExecutor(Object obj, Object identifier, Object arg)` Return a property setter.
`void` | `setClassLoader(ClassLoader loader)` Sets the underlying class loader for class solving resolution.
`protected Integer` | `toInteger(Object arg)` Coerce an Object to an Integer.
`protected String` | `toString(Object arg)` Coerce an Object to a String.

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 to use for all warnings & errors.

Constructor Detail

### Introspector

    protected Introspector(org.apache.commons.logging.Log log)

  Creates an introspector.

  Parameters:
    `log` - the logger to use for warnings.

Method Detail

### toInteger

    protected Integer toInteger(Object arg)

  Coerce an Object to an Integer.

  Parameters:
    `arg` - the Object to coerce
  Returns:
    an Integer if it can be converted, null otherwise

### toString

    protected String toString(Object arg)

  Coerce an Object to a String.

  Parameters:
    `arg` - the Object to coerce
  Returns:
    a String if it can be converted, null otherwise

### base

    protected final IntrospectorBase base()

  Gets the current introspector base.

  If the reference has been collected, this method will recreate the underlying introspector.

  Returns:
    the introspector

### setClassLoader

    public void setClassLoader(ClassLoader loader)

  Sets the underlying class loader for class solving resolution.

  Parameters:
    `loader` - the loader to use

### getField

    protected final Field getField(Class<?> c,
                                   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 final String[] getFieldNames(Class<?> c)

  Gets the accessible field names known for a given class.

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

### getMethod

    protected final Method getMethod(Class<?> c,
                                     String name,
                                     Object[] params)
                              throws IllegalArgumentException

  Gets the method defined by `name` and `params` for the Class `c`.

  Parameters:
    `c` - Class in which the method search is taking place
    `name` - Name of the method being searched for
    `params` - An array of Objects (not Classes) that describe the the parameters
  Returns:
    The desired Method object.
  Throws:
    `IllegalArgumentException` - When the parameters passed in can not be used for introspection. CSOFF: RedundantThrows

### getMethod

    protected final Method getMethod(Class<?> c,
                                     MethodKey key)
                              throws IllegalArgumentException

  Gets the method defined by `key` and for the Class `c`.

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

### getMethodNames

    public final String[] getMethodNames(Class<?> c)

  Gets the accessible methods names known for a given class.

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

### getConstructor

    public final Constructor<?> getConstructor(Object ctorHandle,
                                               Object[] args)

  Returns a general constructor.

  Parameters:
    `ctorHandle` - the object
    `args` - contrusctor arguments
  Returns:
    a `Constructor`

### getMethodExecutor

    public final AbstractExecutor.Method getMethodExecutor(Object obj,
                                                           String name,
                                                           Object[] args)

  Returns a general method.

  Parameters:
    `obj` - the object
    `name` - the method name
    `args` - method arguments
  Returns:
    a `AbstractExecutor.Method`.

### getGetExecutor

    public final AbstractExecutor.Get getGetExecutor(Object obj,
                                                     Object identifier)

  Return a property getter.

  Parameters:
    `obj` - the object to base the property from.
    `identifier` - property name
  Returns:
    a `AbstractExecutor.Get`.

### getSetExecutor

    public final AbstractExecutor.Set getSetExecutor(Object obj,
                                                     Object identifier,
                                                     Object arg)

  Return a property setter.

  Parameters:
    `obj` - the object to base the property from.
    `identifier` - property name (or identifier)
    `arg` - value to set
  Returns:
    a `AbstractExecutor.Set`.

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.