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 -
Constructor Summary
ConstructorsConstructorDescriptionParametersIfcInvocationHandler
(Object targetObj) Creates a new instance ofParametersIfcInvocationHandler
and sets the wrapped parameters object. -
Method Summary
Modifier and TypeMethodDescriptionThis implementation delegates method invocations to the target object and handles the return value correctly.private static boolean
isFluentResult
(Method method) Checks whether the specified method belongs to an interface which requires fluent result values.
-
Field Details
-
target
The target object of reflection calls.
-
-
Constructor Details
-
ParametersIfcInvocationHandler
Creates a new instance ofParametersIfcInvocationHandler
and sets the wrapped parameters object.- Parameters:
targetObj
- the target object for reflection calls
-
-
Method Details
-
invoke
This implementation delegates method invocations to the target object and handles the return value correctly.- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
isFluentResult
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
-