Class ListGetExecutor

All Implemented Interfaces:
JexlPropertyGet

public final class ListGetExecutor extends AbstractExecutor.Get
Specialized executor to get a property from a List or array.
Since:
2.0
  • Field Details

    • ARRAY_GET

      private static final Method ARRAY_GET
      The java.lang.reflect.Array.get method used as an active marker in ListGet.
    • LIST_GET

      private static final Method LIST_GET
      The java.util.obj.get method used as an active marker in ListGet.
    • property

      private final Integer property
      The property.
  • Constructor Details

    • ListGetExecutor

      private ListGetExecutor(Class<?> clazz, Method method, Integer index)
      Creates an instance.
      Parameters:
      clazz - he class the get method applies to
      method - the method held by this executor
      index - the index to use as an argument to the get method
  • Method Details

    • discover

      public static ListGetExecutor discover(Introspector is, Class<?> clazz, Integer index)
      Attempts to discover a ListGetExecutor.
      Parameters:
      is - the introspector
      clazz - the class to find the get method from
      index - the index to use as an argument to the get method
      Returns:
      the executor if found, null otherwise
    • getTargetProperty

      public Object getTargetProperty()
      Description copied from class: AbstractExecutor
      Gets the property targeted by this executor.
      Overrides:
      getTargetProperty in class AbstractExecutor
      Returns:
      the target property
    • invoke

      public Object invoke(Object obj)
      Description copied from interface: JexlPropertyGet
      Method used to get the property value of an object.
      Parameters:
      obj - the object to get the property value from.
      Returns:
      the property value.
    • tryInvoke

      public Object tryInvoke(Object obj, Object identifier)
      Description copied from interface: JexlPropertyGet
      Attempts to reuse this JexlPropertyGet, checking that it is compatible with the actual set of arguments.
      Parameters:
      obj - the object to invoke the property get upon
      identifier - the property key to get
      Returns:
      the result of the method invocation that should be checked by tryFailed to determine if it succeeded or failed.