public interface IntrospectionHelper
| Modifier and Type | Method and Description |
|---|---|
JavaTypeInfo |
createTypeInfo(java.lang.reflect.Type type,
TypeMapping typeMapping)
Creates a JavaTypeInfo for a given type based on the class hierarchy the type is used in.
|
java.lang.Class<?> |
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 super class.
|
java.util.Set<java.lang.reflect.Field> |
getInjectionFields(java.lang.Class<?> type)
Returns method injection sites provided by a class or any super class.
|
java.util.Set<java.lang.reflect.Method> |
getInjectionMethods(java.lang.Class<?> type,
java.util.Collection<org.fabric3.api.model.type.component.Service<org.fabric3.api.model.type.component.ComponentType>> services)
Returns method injection sites provided by a class or any super class.
|
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.fabric3.api.model.type.java.InjectableType |
inferType(java.lang.reflect.Type type,
TypeMapping typeMapping)
Heuristically determines the injection type of the field, method, or constructor parameter associated with the given type.
|
MultiplicityType |
introspectMultiplicity(java.lang.reflect.Type type,
TypeMapping typeMapping)
Introspects the type Returns true if the supplied type should be treated as many-valued.
|
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 super interface.
|
java.lang.Class<?> |
loadClass(java.lang.String name,
java.lang.ClassLoader cl)
Load the class using the supplied ClassLoader.
|
void |
processMultiplicity(org.fabric3.api.model.type.component.Reference definition,
boolean required,
java.lang.reflect.Type type,
TypeMapping typeMapping)
Add multiplicity metadata to the reference definition, including cardinality and if the multiplicity is keyed.
|
void |
resolveTypeParameters(java.lang.Class<?> type,
TypeMapping typeMapping)
Resolves the formal parameters of a class, its super class and super interfaces to the concrete types.
|
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 itImplementationNotFoundException - if the class could not be foundjava.lang.String getSiteName(java.lang.reflect.Field field,
java.lang.String override)
field - the field to inspectoverride - an override specified in an annotationjava.lang.String getSiteName(java.lang.reflect.Method setter,
java.lang.String override)
setter - the setter method to inspectoverride - an override specified in an annotationjava.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 annotationjava.lang.reflect.Type getGenericType(java.lang.reflect.Method setter)
setter - the method to inspectjava.lang.reflect.Type getGenericType(java.lang.reflect.Method method,
int index)
method - the method to inspectindex - the parameter indexjava.lang.reflect.Type getGenericType(java.lang.reflect.Constructor<?> constructor,
int index)
constructor - the constructor to inspectindex - the parameter indexvoid processMultiplicity(org.fabric3.api.model.type.component.Reference definition,
boolean required,
java.lang.reflect.Type type,
TypeMapping typeMapping)
definition - the reference definitionrequired - whether a value must be supplied (implies 1.. multiplicity)type - the multiplicity of a typetypeMapping - the current introspection type mapping @return the multiplicity of the typeMultiplicityType introspectMultiplicity(java.lang.reflect.Type type, TypeMapping typeMapping)
type - the type to checktypeMapping - the mapping to use to resolve any formal typesorg.fabric3.api.model.type.java.InjectableType inferType(java.lang.reflect.Type type,
TypeMapping typeMapping)
type - the type to infertypeMapping - the type mapping for resolved parametersboolean isAnnotationPresent(java.lang.Class<?> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
type - the interface to checkannotationType - the annotation to look forvoid resolveTypeParameters(java.lang.Class<?> type,
TypeMapping typeMapping)
type - the class whose parameters should be resolvedtypeMapping - the type mapping to update with resolved typesJavaTypeInfo createTypeInfo(java.lang.reflect.Type type, TypeMapping typeMapping)
type - the type to introspecttypeMapping - the type mapping to use for introspecting the class hierarchyjava.lang.Class<?> getBaseType(java.lang.reflect.Type type,
TypeMapping typeMapping)
type - the type of a field or parametertypeMapping - the mapping to use to resolve any formal typesjava.util.Set<java.lang.Class<?>> getImplementedInterfaces(java.lang.Class<?> type)
type - the class whose interfaces should be returnedjava.util.Set<java.lang.reflect.Method> getInjectionMethods(java.lang.Class<?> type,
java.util.Collection<org.fabric3.api.model.type.component.Service<org.fabric3.api.model.type.component.ComponentType>> services)
type - the class whose method sites should be returnedservices - the services implemented by the classjava.util.Set<java.lang.reflect.Field> getInjectionFields(java.lang.Class<?> type)
type - the class whose field injection sites should be returned