Class Parameters.ParametersIfcInvocationHandler

java.lang.Object
org.apache.commons.configuration2.builder.fluent.Parameters.ParametersIfcInvocationHandler
All Implemented Interfaces:
InvocationHandler
Enclosing class:
Parameters

private static final class Parameters.ParametersIfcInvocationHandler extends Object implements InvocationHandler
A specialized InvocationHandler implementation which maps the methods of a parameters interface to an implementation of the corresponding property interfaces. The parameters interface is a union of multiple property interfaces. The wrapped object implements all of these, but not the union interface. Therefore, a reflection-based approach is required. A special handling is required for the method of the BuilderParameters interface because here no fluent return value is used.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Object
    The target object of reflection calls.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of ParametersIfcInvocationHandler and sets the wrapped parameters object.
  • Method Summary

    Modifier and Type
    Method
    Description
    invoke(Object proxy, Method method, Object[] args)
    This implementation delegates method invocations to the target object and handles the return value correctly.
    private static boolean
    Checks whether the specified method belongs to an interface which requires fluent result values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • target

      private final Object target
      The target object of reflection calls.
  • Constructor Details

    • ParametersIfcInvocationHandler

      public ParametersIfcInvocationHandler(Object targetObj)
      Creates a new instance of ParametersIfcInvocationHandler and sets the wrapped parameters object.
      Parameters:
      targetObj - the target object for reflection calls
  • Method Details

    • isFluentResult

      private static boolean isFluentResult(Method method)
      Checks whether the specified method belongs to an interface which requires fluent result values.
      Parameters:
      method - the method to be checked
      Returns:
      a flag whether the method's result should be handled as a fluent result value
    • invoke

      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
      This implementation delegates method invocations to the target object and handles the return value correctly.
      Specified by:
      invoke in interface InvocationHandler
      Throws:
      Throwable