public class Injection
extends java.lang.Object
com.github.fungal.api.util.Injection
class.Constructor and Description |
---|
Injection()
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.reflect.Field |
findField(java.lang.Class<?> clz,
java.lang.String fieldName,
java.lang.String fieldType)
Find a field
|
protected java.lang.reflect.Method |
findMethod(java.lang.Class<?> clz,
java.lang.String methodName,
java.lang.String propertyType)
Find a method
|
protected java.lang.String |
getSubstitutionValue(java.lang.String input)
System property substitution
|
protected java.lang.Object |
getValue(java.lang.String name,
java.lang.Class<?> clz,
java.lang.Object v,
java.lang.ClassLoader cl)
Get the value
|
void |
inject(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object propertyValue)
Inject a value into an object property
|
void |
inject(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object propertyValue,
java.lang.String propertyType)
Inject a value into an object property
|
void |
inject(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object propertyValue,
java.lang.String propertyType,
boolean includeFields)
Inject a value into an object property
|
public void inject(java.lang.Object object, java.lang.String propertyName, java.lang.Object propertyValue) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
object
- The objectpropertyName
- The property namepropertyValue
- The property valuejava.lang.NoSuchMethodException
- If the property method cannot be foundjava.lang.IllegalAccessException
- If the property method cannot be accessedjava.lang.reflect.InvocationTargetException
- If the property method cannot be executedpublic void inject(java.lang.Object object, java.lang.String propertyName, java.lang.Object propertyValue, java.lang.String propertyType) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
object
- The objectpropertyName
- The property namepropertyValue
- The property valuepropertyType
- The property type as a fully quilified class namejava.lang.NoSuchMethodException
- If the property method cannot be foundjava.lang.IllegalAccessException
- If the property method cannot be accessedjava.lang.reflect.InvocationTargetException
- If the property method cannot be executedpublic void inject(java.lang.Object object, java.lang.String propertyName, java.lang.Object propertyValue, java.lang.String propertyType, boolean includeFields) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.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 foundjava.lang.NoSuchMethodException
- If the property method cannot be foundjava.lang.IllegalAccessException
- If the property method cannot be accessedjava.lang.reflect.InvocationTargetException
- If the property method cannot be executedprotected java.lang.reflect.Method findMethod(java.lang.Class<?> clz, java.lang.String methodName, java.lang.String propertyType)
clz
- The classmethodName
- The method namepropertyType
- The property type; can be null
null
if not foundprotected java.lang.reflect.Field findField(java.lang.Class<?> clz, java.lang.String fieldName, java.lang.String fieldType)
clz
- The classfieldName
- The field namefieldType
- The field type; can be null
null
if not foundprotected java.lang.Object getValue(java.lang.String name, java.lang.Class<?> clz, java.lang.Object v, java.lang.ClassLoader cl) throws java.lang.Exception
name
- The value nameclz
- The value classv
- The valuecl
- The class loaderjava.lang.Exception
- Thrown in case of an errorprotected java.lang.String getSubstitutionValue(java.lang.String input)
input
- The input stringCopyright © 2013 IronJacamar (http://www.ironjacamar.org)