|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IntrospectionHelper
Helper service that provides support methods to simplify introspection.
| Method Summary | |
|---|---|
java.lang.reflect.Type |
getBaseType(java.lang.reflect.Type type,
TypeMapping typeMapping)
Returns the base type for the supplied type. |
java.lang.reflect.Type |
getGenericType(java.lang.reflect.Constructor<?> constructor,
int index)
Returns the generic type of a constructor parameter. |
java.lang.reflect.Type |
getGenericType(java.lang.reflect.Method setter)
Returns the generic type of a setter method. |
java.lang.reflect.Type |
getGenericType(java.lang.reflect.Method method,
int index)
Returns the generic type of a method parameter. |
java.util.Set<java.lang.Class<?>> |
getImplementedInterfaces(java.lang.Class<?> type)
Returns all service interfaces directly implemented by a class or any superclass. |
java.util.Set<java.lang.reflect.Field> |
getInjectionFields(java.lang.Class<?> type)
Returns method injection sites provided by a class or any superclass. |
java.util.Set<java.lang.reflect.Method> |
getInjectionMethods(java.lang.Class<?> type,
java.util.Collection<org.sca4j.scdl.ServiceDefinition> services)
Returns method injection sites provided by a class or any superclass. |
java.lang.String |
getSiteName(java.lang.reflect.Constructor<?> constructor,
int index,
java.lang.String override)
Derive the name of an injection site from a setter method. |
java.lang.String |
getSiteName(java.lang.reflect.Field field,
java.lang.String override)
Derive the name of an injection site from a field. |
java.lang.String |
getSiteName(java.lang.reflect.Method setter,
java.lang.String override)
Derive the name of an injection site from a setter method. |
org.sca4j.scdl.InjectableAttributeType |
inferType(java.lang.reflect.Type type,
TypeMapping typeMapping)
|
boolean |
isAnnotationPresent(java.lang.Class<?> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if an annotation is present on this interface or any superinterface. |
boolean |
isManyValued(TypeMapping typeMapping,
java.lang.reflect.Type type)
Returns true if the supplied type should be treated as many-valued. |
java.lang.Class<?> |
loadClass(java.lang.String name,
java.lang.ClassLoader cl)
Load the class using the supplied ClassLoader. |
TypeMapping |
mapTypeParameters(java.lang.Class<?> type)
Map the formal parameters of a type, its superclass and superinterfaces to the actual parameters of the class. |
| Method Detail |
|---|
java.lang.Class<?> loadClass(java.lang.String name,
java.lang.ClassLoader cl)
throws ImplementationNotFoundException
name - the name of the class to loadcl - the classloader to use to load it
ImplementationNotFoundException - if the class could not be found
java.lang.String getSiteName(java.lang.reflect.Field field,
java.lang.String override)
field - the field to inspectoverride - an override specified in an annotation
java.lang.String getSiteName(java.lang.reflect.Method setter,
java.lang.String override)
setter - the setter method to inspectoverride - an override specified in an annotation
java.lang.String getSiteName(java.lang.reflect.Constructor<?> constructor,
int index,
java.lang.String override)
constructor - the constructor to inspectindex - the index of the constructor parameter to inspectoverride - an override specified in an annotation
java.lang.reflect.Type getGenericType(java.lang.reflect.Method setter)
setter - the method to inspect
java.lang.reflect.Type getGenericType(java.lang.reflect.Method method,
int index)
method - the method to inspectindex - the parameter index
java.lang.reflect.Type getGenericType(java.lang.reflect.Constructor<?> constructor,
int index)
constructor - the constructor to inspectindex - the parameter index
boolean isManyValued(TypeMapping typeMapping,
java.lang.reflect.Type type)
typeMapping - the mapping to use to resolve any formal typestype - the type to check
org.sca4j.scdl.InjectableAttributeType inferType(java.lang.reflect.Type type,
TypeMapping typeMapping)
boolean isAnnotationPresent(java.lang.Class<?> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
type - the interface to checkannotationType - the annotation to look for
TypeMapping mapTypeParameters(java.lang.Class<?> type)
type - the class whose parameters should be mapped
java.lang.reflect.Type getBaseType(java.lang.reflect.Type type,
TypeMapping typeMapping)
type - the type of a field or parametertypeMapping - the mapping to use to resolve any formal types
java.util.Set<java.lang.Class<?>> getImplementedInterfaces(java.lang.Class<?> type)
type - the class whose interfaces should be returned
java.util.Set<java.lang.reflect.Method> getInjectionMethods(java.lang.Class<?> type,
java.util.Collection<org.sca4j.scdl.ServiceDefinition> services)
type - the class whose method sites should be returnedservices - the services implemented by the class
java.util.Set<java.lang.reflect.Field> getInjectionFields(java.lang.Class<?> type)
type - the class whose field injection sites should be returned
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||