public final class ReflectionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
callMethodAndGetResult(Method method,
Object instance,
InputStream inputStream,
OutputStream outputStream)
To be used for invoking skill code of type SkillServlet.
|
static void |
callMethodAndGetResult(Method method,
Object instance,
InputStream inputStream,
OutputStream outputStream,
com.amazonaws.services.lambda.runtime.Context context)
To be used to invoke handleRequest method for skill code extending SkillStreamHandler.
|
static Object |
createClassInstance(Class<?> classObject)
Creates instance from classObject.
|
static Class<?> |
getClassReference(String fullyQualifiedClassName)
Returns Class reference for a full qualified class name.
|
static Method |
getMethod(Class<?> classObject,
String methodName,
Class<?>[] paramTypes)
Creates
Method reference. |
static String |
getSuperClassName(Class<?> classObject)
Gets the name of the super class for the class object.
|
public static Class<?> getClassReference(String fullyQualifiedClassName)
fullyQualifiedClassName
- - fully qualified class name. Current use cases
1. Class name will be the name of SkillStreamHandlerClass.public static String getSuperClassName(Class<?> classObject)
classObject
- Object for which the extended class needs to be determined.public static Object createClassInstance(Class<?> classObject)
classObject
- - class object for which an instance will be created.public static Method getMethod(Class<?> classObject, String methodName, Class<?>[] paramTypes)
Method
reference.classObject
- - Class object in which the method resides.methodName
- - Name of the method.paramTypes
- - Method's paramter types.Method
public static void callMethodAndGetResult(Method method, Object instance, InputStream inputStream, OutputStream outputStream)
method
- - handleRequest method.instance
- - instance of skill entry class.inputStream
- - input stream of the request envelope.outputStream
- - output stream of the response envelope.public static void callMethodAndGetResult(Method method, Object instance, InputStream inputStream, OutputStream outputStream, com.amazonaws.services.lambda.runtime.Context context)
method
- - handleRequest method.instance
- - instance of skill entry class.inputStream
- - input stream of the request envelope.outputStream
- - output stream of the response envelope.context
- - lambda context class.Copyright © 2023. All rights reserved.