Class Parameters.ParametersIfcInvocationHandler
- java.lang.Object
-
- org.apache.commons.configuration2.builder.fluent.Parameters.ParametersIfcInvocationHandler
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
- Enclosing class:
- Parameters
private static final class Parameters.ParametersIfcInvocationHandler extends java.lang.Object implements java.lang.reflect.InvocationHandler
A specializedInvocationHandler
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 theBuilderParameters
interface because here no fluent return value is used.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
target
The target object of reflection calls.
-
Constructor Summary
Constructors Constructor Description ParametersIfcInvocationHandler(java.lang.Object targetObj)
Creates a new instance ofParametersIfcInvocationHandler
and sets the wrapped parameters object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
This implementation delegates method invocations to the target object and handles the return value correctly.private static boolean
isFluentResult(java.lang.reflect.Method method)
Checks whether the specified method belongs to an interface which requires fluent result values.
-
-
-
Method Detail
-
isFluentResult
private static boolean isFluentResult(java.lang.reflect.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 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
This implementation delegates method invocations to the target object and handles the return value correctly.- Specified by:
invoke
in interfacejava.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
-
-