public class Reflect extends Object
| Modifier and Type | Method and Description |
|---|---|
static CommunicationMode |
communicationMode(Method method)
This method is used to get catual
CommunicationMode os service method. |
static boolean |
isRequestTypeServiceMessage(Method method)
Util function to check if the first parameter of method is ServiceMessage.
|
static boolean |
isReturnTypeServiceMessage(Method method)
Util function to check if return type of method is ServiceMessage.
|
static boolean |
isSecured(Method method) |
static boolean |
isService(Class<?> type) |
static String |
methodName(Method method) |
static Map<Method,MethodInfo> |
methodsInfo(Class<?> serviceInterface)
Parse
serviceInterface class and puts available methods annotated by ServiceMethod annotation to Method -> MethodInfo mapping. |
static Type |
parameterizedRequestType(Method method)
Util function that returns the parameterized of the request Type of a given object.
|
static Type |
parameterizedReturnType(Method method)
extract parameterized return value of a method.
|
static Type |
parameterizedType(Object object)
Util function that returns the parameterizedType of a given object.
|
static String |
qualifier(Class<?> serviceInterface,
Method method)
Handy method to get qualifier String from service's interface and method.
|
static Class<?> |
requestType(Method method)
Util function returns the the Type of method parameter [0] or Void.Type in case 0 parameters.
|
static Stream<Class<?>> |
serviceInterfaces(Object serviceObject)
Util function to get service interfaces collections from service instance.
|
static Map<String,Method> |
serviceMethods(Class<?> serviceInterface)
Util function to get service Method map from service api.
|
static Map<String,String> |
serviceMethodTags(Method serviceMethod)
Util function to extract service tags from service method api.
|
static String |
serviceName(Class<?> serviceInterface)
Util function to extract service name from service api.
|
static Map<String,String> |
serviceTags(Class<?> serviceInterface)
Util function to extract service tags from service api.
|
static void |
validateMethodOrThrow(Method method)
Util function to perform basic validation of service message request.
|
public static Type parameterizedReturnType(Method method)
method - to extract type from.public static boolean isReturnTypeServiceMessage(Method method)
method - method to inspectpublic static Class<?> requestType(Method method)
method - in inspection.public static boolean isRequestTypeServiceMessage(Method method)
method - method to inspectpublic static Type parameterizedType(Object object)
object - to inspectpublic static Map<Method,MethodInfo> methodsInfo(Class<?> serviceInterface)
serviceInterface class and puts available methods annotated by ServiceMethod annotation to Method -> MethodInfo mapping.serviceInterface - - service interface to be parsed.serviceInterface to their
descriptionspublic static Type parameterizedRequestType(Method method)
public static String serviceName(Class<?> serviceInterface)
serviceInterface - with @Service annotation.public static Map<String,String> serviceTags(Class<?> serviceInterface)
serviceInterface - with @Service annotation.public static Map<String,String> serviceMethodTags(Method serviceMethod)
serviceMethod - with @ServiceMethod annotation.public static Map<String,Method> serviceMethods(Class<?> serviceInterface)
serviceInterface - with @Service annotation.public static Stream<Class<?>> serviceInterfaces(Object serviceObject)
serviceObject - with extends service interface with @Service annotation.public static String qualifier(Class<?> serviceInterface, Method method)
serviceInterface - service interface to get qualifier formethod - service's method to get qualifier forpublic static void validateMethodOrThrow(Method method)
method - service method.public static CommunicationMode communicationMode(Method method)
CommunicationMode os service method.
The following modes are supported:
CommunicationMode.REQUEST_CHANNEL - service has at least one parameter,and the
first parameter is either of type return type Flux or Publisher;
CommunicationMode.REQUEST_STREAM - service's return type is Flux, and
parameter is not Flux;
CommunicationMode.REQUEST_RESPONSE - service's return type is Mono;
CommunicationMode.FIRE_AND_FORGET - service returns void;
method - - Service method to be analyzed.CommunicationMode of service method. If method does not correspond to any of
supported modes, throws IllegalArgumentExceptionpublic static boolean isService(Class<?> type)
public static boolean isSecured(Method method)
Copyright © 2015–2021. All rights reserved.