Class BooleanGetExecutor

All Implemented Interfaces:
JexlPropertyGet

public final class BooleanGetExecutor extends AbstractExecutor.Get
Specialized executor to get a boolean property from an object.
Since:
2.0
  • Field Details

    • property

      private final String property
      The property.
  • Constructor Details

    • BooleanGetExecutor

      private BooleanGetExecutor(Class<?> clazz, Method method, String key)
      Creates an instance by attempting discovery of the get method.
      Parameters:
      clazz - the class to introspect
      method - the method held by this executor
      key - the property to get
  • Method Details

    • discover

      public static BooleanGetExecutor discover(Introspector is, Class<?> clazz, String property)
      Discovers a BooleanGetExecutor.

      The method to be found should be named "is{P,p}property and return a boolean.

      Parameters:
      is - the introspector
      clazz - the class to find the get method from
      property - the property name
      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

      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.
      Throws:
      IllegalAccessException
      InvocationTargetException
    • tryInvoke

      public Object tryInvoke(Object obj, Object key)
      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
      key - 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.