Package space.arim.dazzleconf.reflect
Class DefaultReflectionService
java.lang.Object
space.arim.dazzleconf.reflect.DefaultReflectionService
- All Implemented Interfaces:
ReflectionService
The default implementation of
ReflectionService.
It uses standard reflection to find and call methods, and java.lang.reflect.Proxy to generate classes
implementing the configuration interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull InstantiatormakeInstantiator(@NonNull MethodHandles.Lookup lookup) Gets the instantiator this service provides.@NonNull MethodMirrormakeMethodMirror(@NonNull MethodHandles.Lookup lookup) Gets theMethodMirrorthis service provides.
-
Constructor Details
-
DefaultReflectionService
public DefaultReflectionService()Creates the service
-
-
Method Details
-
makeInstantiator
Description copied from interface:ReflectionServiceGets the instantiator this service provides.The instantiator is responsible for generating and instantiating implementations of the configuration interface.
- Specified by:
makeInstantiatorin interfaceReflectionService- Parameters:
lookup- the lookup to use for privileged access- Returns:
- an instantiator
-
makeMethodMirror
Description copied from interface:ReflectionServiceGets theMethodMirrorthis service provides.The method mirror is responsible for
The method mirror is supplied by this function, and it may share resources and techniques with the instantiator. In particular,
MethodMirror.makeInvoker(Object, Class)can be more efficient when used with objects generated by the same instantiator inReflectionService.makeInstantiator(MethodHandles.Lookup).- Specified by:
makeMethodMirrorin interfaceReflectionService- Parameters:
lookup- the lookup to use for privileged access- Returns:
- a method mirror
-