|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.jca.adapters.jdbc.util.Injection
public class Injection

Injection utility which can inject values into objects. This file is a copy
of the com.github.fungal.api.util.Injection class.
| Constructor Summary | |
|---|---|
Injection()
Constructor |
|
| Method Summary | |
|---|---|
protected Field |
findField(Class<?> clz,
String fieldName,
String fieldType)
Find a field |
protected Method |
findMethod(Class<?> clz,
String methodName,
String propertyType)
Find a method |
protected String |
getSubstitutionValue(String input)
System property substitution |
protected Object |
getValue(String name,
Class<?> clz,
Object v,
ClassLoader cl)
Get the value |
void |
inject(Object object,
String propertyName,
Object propertyValue)
Inject a value into an object property |
void |
inject(Object object,
String propertyName,
Object propertyValue,
String propertyType)
Inject a value into an object property |
void |
inject(Object object,
String propertyName,
Object propertyValue,
String propertyType,
boolean includeFields)
Inject a value into an object property |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Injection()
| Method Detail |
|---|
public void inject(Object object,
String propertyName,
Object propertyValue)
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException
object - The objectpropertyName - The property namepropertyValue - The property value
NoSuchMethodException - If the property method cannot be found
IllegalAccessException - If the property method cannot be accessed
InvocationTargetException - If the property method cannot be executed
public void inject(Object object,
String propertyName,
Object propertyValue,
String propertyType)
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException
object - The objectpropertyName - The property namepropertyValue - The property valuepropertyType - The property type as a fully quilified class name
NoSuchMethodException - If the property method cannot be found
IllegalAccessException - If the property method cannot be accessed
InvocationTargetException - If the property method cannot be executed
public void inject(Object object,
String propertyName,
Object propertyValue,
String propertyType,
boolean includeFields)
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException
object - The objectpropertyName - The property namepropertyValue - The property valuepropertyType - The property type as a fully quilified class nameincludeFields - Should fields be included for injection if a method can't be found
NoSuchMethodException - If the property method cannot be found
IllegalAccessException - If the property method cannot be accessed
InvocationTargetException - If the property method cannot be executed
protected Method findMethod(Class<?> clz,
String methodName,
String propertyType)
clz - The classmethodName - The method namepropertyType - The property type; can be null
null if not found
protected Field findField(Class<?> clz,
String fieldName,
String fieldType)
clz - The classfieldName - The field namefieldType - The field type; can be null
null if not found
protected Object getValue(String name,
Class<?> clz,
Object v,
ClassLoader cl)
throws Exception
name - The value nameclz - The value classv - The valuecl - The class loader
Exception - Thrown in case of an errorprotected String getSubstitutionValue(String input)
input - The input string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||