public class ParameterInjection extends Object
This class provides some utility methods for injecting parameters into an object by the use of Java's reflection API.
| Modifier and Type | Field and Description |
|---|---|
(package private) static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
ParameterInjection() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
checkForMissingParametersAndSetters(Object o,
Map<String,?> params,
Set<String> skip)
This methods checks for the XMLParameter annotation in the processor and
if the corresponindg parameters or setter methods are missing.
|
static Map<String,String> |
extract(Object learner) |
static boolean |
hasGetter(Class<?> clazz,
String name) |
static Set<String> |
inject(Object o,
Map<String,?> params,
Variables variableContext)
This method injects a set of parameters to the given object.
|
static void |
injectSystemProperties(Object object,
String prefix) |
static boolean |
isGetter(Method m) |
static boolean |
isNativeType(Class<?> clazz) |
static boolean |
isQueueArraySetter(Method m) |
static boolean |
isQueueSetter(Method m) |
static boolean |
isTypeSupported(Class<?> clazz) |
public static Set<String> inject(Object o, Map<String,?> params, Variables variableContext) throws Exception
o - The object to inject parameters into.params - The parameters to set on the object.Exceptionprivate static void checkForMissingParametersAndSetters(Object o, Map<String,?> params, Set<String> skip) throws ParameterException
o - the processor instanceparams - the params map from the xml fileParameterException - in case parameter or setter is missingpublic static void injectSystemProperties(Object object, String prefix) throws Exception
Exceptionpublic static boolean isGetter(Method m)
public static boolean isTypeSupported(Class<?> clazz)
public static boolean isNativeType(Class<?> clazz)
public static boolean isQueueSetter(Method m)
public static boolean isQueueArraySetter(Method m)
Copyright © 2018. All rights reserved.