JexlUberspect (Apache Commons JEXL 3.6.3 API)
Description: declaration: package: org.apache.commons.jexl3.introspection, interface: JexlUberspect

Package org.apache.commons.jexl3.introspection

# Interface JexlUberspect

public interface JexlUberspect
'Federated' introspection/reflection interface to allow JEXL introspection behavior to be customized.

Since:
  1.0

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `JexlUberspect.ClassConstantResolver`
  A marker interface that solves a class constant by name.
  `static interface`
  `JexlUberspect.ClassNameResolver`
  A marker interface that solves a simple class name into a fully qualified one.
  `static interface`
  `JexlUberspect.ConstantResolverFactory`
  The factory type for creating constant resolvers.
  `static enum`
  `JexlUberspect.JexlResolver`
  The various builtin property resolvers.
  `static interface`
  `JexlUberspect.PropertyResolver`
  Abstracts getting property setter and getter.
  `static interface`
  `JexlUberspect.ResolverStrategy`
  Determines property resolution strategy.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final JexlUberspect.ResolverStrategy`
  `JEXL_STRATEGY`
  The default strategy.
  `static final List<JexlUberspect.PropertyResolver>`
  `MAP`
  A resolver types list tailored for Maps, favors '[]' over '.'.
  `static final JexlUberspect.ResolverStrategy`
  `MAP_STRATEGY`
  The map strategy.
  `static final List<JexlUberspect.PropertyResolver>`
  `POJO`
  A resolver types list tailored for POJOs, favors '.' over '[]'.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JexlArithmetic.Uberspect`
  `getArithmetic(JexlArithmetic arithmetic)`
  Gets an arithmetic operator resolver for a given arithmetic instance.
  `default Class<?>`
  `getClassByName(String className)`
  Seeks a class by name using this uberspect class-loader.
  `ClassLoader`
  `getClassLoader()`
  Gets the current class loader.
  `JexlMethod`
  `getConstructor(Object ctorHandle, Object... args)`
  Returns a class constructor.
  `Iterator<?>`
  `getIterator(Object obj)`
  Gets an iterator from an object.
  `JexlMethod`
  `getMethod(Object obj, String method, Object... args)`
  Returns a JexlMethod.
  `default JexlOperator.Uberspect`
  `getOperator(JexlArithmetic arithmetic)`
  Gets an arithmetic operator executor for a given arithmetic instance.
  `JexlPropertyGet`
  `getPropertyGet(Object obj, Object identifier)`
  Property getter.
  `JexlPropertyGet`
  `getPropertyGet(List<JexlUberspect.PropertyResolver> resolvers, Object obj, Object identifier)`
  Property getter.
  `JexlPropertySet`
  `getPropertySet(Object obj, Object identifier, Object arg)`
  Property setter.
  `JexlPropertySet`
  `getPropertySet(List<JexlUberspect.PropertyResolver> resolvers, Object obj, Object identifier, Object arg)`
  Property setter.
  `List<JexlUberspect.PropertyResolver>`
  `getResolvers(JexlOperator op, Object obj)`
  Applies this uberspect property resolver strategy.
  `int`
  `getVersion()`
  Gets this uberspect version.
  `void`
  `setClassLoader(ClassLoader loader)`
  Sets the class loader to use.

- ## Field Details

  - ### POJO

    static final List<JexlUberspect.PropertyResolver> POJO
    A resolver types list tailored for POJOs, favors '.' over '[]'.

  - ### MAP

    static final List<JexlUberspect.PropertyResolver> MAP
    A resolver types list tailored for Maps, favors '[]' over '.'.

  - ### JEXL_STRATEGY

    static final JexlUberspect.ResolverStrategy JEXL_STRATEGY
    The default strategy.

    If the operator is '[]' or if the operator is null and the object is a map, use the MAP list of resolvers; Other cases use the POJO list of resolvers.

  - ### MAP_STRATEGY

    static final JexlUberspect.ResolverStrategy MAP_STRATEGY
    The map strategy.

    If the operator is '[]' or if the object is a map, use the MAP list of resolvers. Otherwise, use the POJO list of resolvers.

- ## Method Details

  - ### getArithmetic

    JexlArithmetic.Uberspect getArithmetic(JexlArithmetic arithmetic)
    Gets an arithmetic operator resolver for a given arithmetic instance.
    Parameters:
      `arithmetic` - the arithmetic instance
    Returns:
      the arithmetic uberspect or null if no operator method were overridden
    Since:
      3.0
    See Also:
      - `getOperator(JexlArithmetic)`

  - ### getOperator

    default JexlOperator.Uberspect getOperator(JexlArithmetic arithmetic)
    Gets an arithmetic operator executor for a given arithmetic instance.
    Parameters:
      `arithmetic` - the arithmetic instance
    Returns:
      an operator uberspect instance
    Since:
      3.5.0

  - ### getClassByName

    default Class<?> getClassByName(String className)
    Seeks a class by name using this uberspect class-loader.
    Parameters:
      `className` - the class name
    Returns:
      the class instance or null if the class cannot be located by this uberspect class loader or if permissions deny access to the class

  - ### getClassLoader

    ClassLoader getClassLoader()
    Gets the current class loader.
    Returns:
      the class loader

  - ### getConstructor

    JexlMethod getConstructor(Object ctorHandle, Object... args)
    Returns a class constructor.
    Parameters:
      `ctorHandle` - a class or class name
      `args` - constructor arguments
    Returns:
      a `JexlMethod`
    Since:
      3.0

  - ### getIterator

    Iterator<?> getIterator(Object obj)
    Gets an iterator from an object.
    Parameters:
      `obj` - to get the iterator from
    Returns:
      an iterator over obj or null

  - ### getMethod

    JexlMethod getMethod(Object obj, String method, Object... args)
    Returns a JexlMethod.
    Parameters:
      `obj` - the object
      `method` - the method name
      `args` - method arguments
    Returns:
      a `JexlMethod`

  - ### getPropertyGet

    JexlPropertyGet getPropertyGet(List<JexlUberspect.PropertyResolver> resolvers, Object obj, Object identifier)
    Property getter.

    Seeks a JexlPropertyGet apropos to an expression like `bar.woogie`.

    See `JexlUberspect.ResolverStrategy.apply(JexlOperator, Object)`
    Parameters:
      `resolvers` - the list of property resolvers to try
      `obj` - the object to get the property from
      `identifier` - property name
    Returns:
      a `JexlPropertyGet` or null
    Since:
      3.0

  - ### getPropertyGet

    JexlPropertyGet getPropertyGet(Object obj, Object identifier)
    Property getter.

    returns a JelPropertySet apropos to an expression like `bar.woogie`.

    Parameters:
      `obj` - the object to get the property from
      `identifier` - property name
    Returns:
      a `JexlPropertyGet` or null

  - ### getPropertySet

    JexlPropertySet getPropertySet(List<JexlUberspect.PropertyResolver> resolvers, Object obj, Object identifier, Object arg)
    Property setter.

    Seeks a JelPropertySet apropos to an expression like `foo.bar = "geir"`.

    See `JexlUberspect.ResolverStrategy.apply(JexlOperator, Object)`
    Parameters:
      `resolvers` - the list of property resolvers to try,
      `obj` - the object to get the property from
      `identifier` - property name
      `arg` - value to set
    Returns:
      a `JexlPropertySet` or null
    Since:
      3.0

  - ### getPropertySet

    JexlPropertySet getPropertySet(Object obj, Object identifier, Object arg)
    Property setter.

    Seeks a JelPropertySet apropos to an expression like `foo.bar = "geir"`.

    Parameters:
      `obj` - the object to get the property from.
      `identifier` - property name
      `arg` - value to set
    Returns:
      a `JexlPropertySet` or null

  - ### getResolvers

    List<JexlUberspect.PropertyResolver> getResolvers(JexlOperator op, Object obj)
    Applies this uberspect property resolver strategy.
    Parameters:
      `op` - the operator
      `obj` - the object
    Returns:
      the applied strategy resolver list

  - ### getVersion

    int getVersion()
    Gets this uberspect version.
    Returns:
      the class loader modification count

  - ### setClassLoader

    void setClassLoader(ClassLoader loader)
    Sets the class loader to use.

    This increments the version.

    Parameters:
      `loader` - the class loader