Package jadex.micro
Class MicroClassReader
- java.lang.Object
- 
- jadex.micro.MicroClassReader
 
- 
- Direct Known Subclasses:
- BDIClassReader
 
 public class MicroClassReader extends java.lang.ObjectReads micro agent classes and generates a model from metainfo and annotations.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classMicroClassReader.DummyClassLoader
 - 
Constructor SummaryConstructors Constructor Description MicroClassReader()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckAndAddRequiredServiceInfo(RequiredServiceInfo rsis, java.util.Map<java.lang.String,java.lang.Object> rsers, java.lang.ClassLoader cl)protected voidcheckMethodReturnType(java.lang.Class<? extends java.lang.annotation.Annotation> ann, java.lang.reflect.Method m, java.lang.ClassLoader cl)Check, if the return type of the agent method is acceptable.static RequiredServiceBindingcreateBinding(RequiredService rq)Create a service binding.protected ComponentInstanceInfocreateComponentInstanceInfo(Component comp)Create component instance info from component annotation.static ComponentInstanceInfocreateComponentInstanceInfo(CreationInfo comp)Create component instance info from creation info annotation.static ProvidedServiceImplementationcreateImplementation(Implementation impl, java.lang.Class<?> cma)Create a service implementation.protected static java.util.List<NFRPropertyInfo>createNFRProperties(NFRProperty[] nfrp)Create req service props.protected static RequiredServiceInfocreateRequiredServiceInfo(RequiredService rs, java.lang.ClassLoader cl)Create a required service info from annotation.static UnparsedExpression[]createUnparsedExpressions(Value[] values)Create unparsed expressions.protected java.lang.ObjectevaluateExpression(java.lang.String exp, java.lang.String[] imports, IValueFetcher fetcher, java.lang.ClassLoader classloader)Evaluate an expression string (using "" -> null mapping) as annotations do not support null values.protected voidfillMicroModelFromAnnotations(MicroModel micromodel, java.lang.String model, java.lang.Class<?> clazz, java.lang.ClassLoader cl)Fill the model details using annotation.static voidfindInjections(java.lang.Class<?> cma, java.lang.ClassLoader cl, InjectionInfoHolder ii, java.util.Map<java.lang.String,java.lang.Object> rsers)Find injections:static <T extends java.lang.annotation.Annotation>
 TgetAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)static <T extends java.lang.annotation.Annotation>
 TgetAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> anclazz, java.lang.ClassLoader cl1, java.lang.ClassLoader cl2)static <T extends java.lang.annotation.Annotation>
 TgetAnnotation(java.lang.reflect.Constructor<?> c, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)static <T extends java.lang.annotation.Annotation>
 TgetAnnotation(java.lang.reflect.Field f, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)static <T extends java.lang.annotation.Annotation>
 TgetAnnotation(java.lang.reflect.Method m, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)static java.lang.Class<?>getClass(java.lang.Class<?> clazz, java.lang.ClassLoader cl)static java.lang.Class<?>[]getClassArray(java.lang.Class<?>[] clazzes, java.lang.ClassLoader cl)protected java.lang.Class<?>getMicroAgentClass(java.lang.String clname, java.lang.String[] imports, java.lang.ClassLoader classloader)Get the mirco agent class.protected java.util.List<java.lang.Object>getOrCreateList(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)Get or create a list.protected java.util.Map<java.lang.String,java.lang.Object>getOrCreateMap(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)Get or create a map.protected java.util.Set<java.lang.Object>getOrCreateSet(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)Get or create a set.static java.lang.annotation.Annotation[][]getParameterAnnotations(java.lang.reflect.Constructor c, java.lang.ClassLoader cl)static java.lang.annotation.Annotation[][]getParameterAnnotations(java.lang.reflect.Method m, java.lang.ClassLoader cl)static <T extends java.lang.annotation.Annotation>
 TgetProxyAnnotation(T an, java.lang.ClassLoader cl)Gets proxy annotation that can be invoked by corresponding classloader.protected static java.lang.StringguessName(java.lang.String methodname)protected static java.lang.Class<?>guessParameterType(java.lang.Class<?>[] ptypes, java.lang.ClassLoader cl)static booleanisAnnotationPresent(java.lang.Class<?> clazz, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)static booleanisAnnotationPresent(java.lang.reflect.Constructor<?> con, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)static booleanisAnnotationPresent(java.lang.reflect.Field f, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)static booleanisAnnotationPresent(java.lang.reflect.Method m, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)protected static booleanisClassLoaderCompatible(java.lang.Class<?> clazz, java.lang.ClassLoader cl)protected MicroModelread(java.lang.String model, java.lang.Class<?> cma, java.lang.ClassLoader classloader, IResourceIdentifier rid, IComponentIdentifier root, java.util.List<IComponentFeatureFactory> features)Load the model.MicroModelread(java.lang.String model, java.lang.String[] imports, java.lang.ClassLoader classloader, IResourceIdentifier rid, IComponentIdentifier root, java.util.List<IComponentFeatureFactory> features)Load a model.
 
- 
- 
- 
Method Detail- 
readpublic MicroModel read(java.lang.String model, java.lang.String[] imports, java.lang.ClassLoader classloader, IResourceIdentifier rid, IComponentIdentifier root, java.util.List<IComponentFeatureFactory> features) Load a model.- Parameters:
- model- The model (e.g. file name).
- The- imports (if any).
- Returns:
- The loaded model.
 
 - 
readprotected MicroModel read(java.lang.String model, java.lang.Class<?> cma, java.lang.ClassLoader classloader, IResourceIdentifier rid, IComponentIdentifier root, java.util.List<IComponentFeatureFactory> features) Load the model.
 - 
fillMicroModelFromAnnotationsprotected void fillMicroModelFromAnnotations(MicroModel micromodel, java.lang.String model, java.lang.Class<?> clazz, java.lang.ClassLoader cl) Fill the model details using annotation.
 - 
checkMethodReturnTypeprotected void checkMethodReturnType(java.lang.Class<? extends java.lang.annotation.Annotation> ann, java.lang.reflect.Method m, java.lang.ClassLoader cl)Check, if the return type of the agent method is acceptable.
 - 
createRequiredServiceInfoprotected static RequiredServiceInfo createRequiredServiceInfo(RequiredService rs, java.lang.ClassLoader cl) Create a required service info from annotation.
 - 
getOrCreateMapprotected java.util.Map<java.lang.String,java.lang.Object> getOrCreateMap(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)Get or create a map.
 - 
getOrCreateListprotected java.util.List<java.lang.Object> getOrCreateList(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)Get or create a list.
 - 
getOrCreateSetprotected java.util.Set<java.lang.Object> getOrCreateSet(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> map)Get or create a set.
 - 
evaluateExpressionprotected java.lang.Object evaluateExpression(java.lang.String exp, java.lang.String[] imports, IValueFetcher fetcher, java.lang.ClassLoader classloader)Evaluate an expression string (using "" -> null mapping) as annotations do not support null values.
 - 
createImplementationpublic static ProvidedServiceImplementation createImplementation(Implementation impl, java.lang.Class<?> cma) Create a service implementation.
 - 
createBindingpublic static RequiredServiceBinding createBinding(RequiredService rq) Create a service binding.
 - 
createNFRPropertiesprotected static java.util.List<NFRPropertyInfo> createNFRProperties(NFRProperty[] nfrp) Create req service props.
 - 
createComponentInstanceInfoprotected ComponentInstanceInfo createComponentInstanceInfo(Component comp) Create component instance info from component annotation.
 - 
createComponentInstanceInfopublic static ComponentInstanceInfo createComponentInstanceInfo(CreationInfo comp) Create component instance info from creation info annotation.
 - 
createUnparsedExpressionspublic static UnparsedExpression[] createUnparsedExpressions(Value[] values) Create unparsed expressions.
 - 
getMicroAgentClassprotected java.lang.Class<?> getMicroAgentClass(java.lang.String clname, java.lang.String[] imports, java.lang.ClassLoader classloader)Get the mirco agent class.
 - 
isAnnotationPresentpublic static boolean isAnnotationPresent(java.lang.Class<?> clazz, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)
 - 
isAnnotationPresentpublic static boolean isAnnotationPresent(java.lang.reflect.Field f, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)
 - 
isAnnotationPresentpublic static boolean isAnnotationPresent(java.lang.reflect.Method m, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)
 - 
isAnnotationPresentpublic static boolean isAnnotationPresent(java.lang.reflect.Constructor<?> con, java.lang.Class<? extends java.lang.annotation.Annotation> anclazz, java.lang.ClassLoader cl)
 - 
getAnnotationpublic static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)
 - 
getAnnotationpublic static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.reflect.Field f, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)
 - 
getAnnotationpublic static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.reflect.Method m, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)
 - 
getAnnotationpublic static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.reflect.Constructor<?> c, java.lang.Class<T> anclazz, java.lang.ClassLoader cl)
 - 
getParameterAnnotationspublic static java.lang.annotation.Annotation[][] getParameterAnnotations(java.lang.reflect.Method m, java.lang.ClassLoader cl)
 - 
getParameterAnnotationspublic static java.lang.annotation.Annotation[][] getParameterAnnotations(java.lang.reflect.Constructor c, java.lang.ClassLoader cl)
 - 
getAnnotationpublic static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> anclazz, java.lang.ClassLoader cl1, java.lang.ClassLoader cl2)
 - 
getClasspublic static java.lang.Class<?> getClass(java.lang.Class<?> clazz, java.lang.ClassLoader cl)
 - 
getClassArraypublic static java.lang.Class<?>[] getClassArray(java.lang.Class<?>[] clazzes, java.lang.ClassLoader cl)
 - 
getProxyAnnotationpublic static <T extends java.lang.annotation.Annotation> T getProxyAnnotation(T an, java.lang.ClassLoader cl)Gets proxy annotation that can be invoked by corresponding classloader.- Returns:
- ret
 
 - 
isClassLoaderCompatibleprotected static boolean isClassLoaderCompatible(java.lang.Class<?> clazz, java.lang.ClassLoader cl)
 - 
findInjectionspublic static void findInjections(java.lang.Class<?> cma, java.lang.ClassLoader cl, InjectionInfoHolder ii, java.util.Map<java.lang.String,java.lang.Object> rsers)Find injections:- Parameters:
- cma-
- cl-
- ii-
- rsers-
 
 - 
guessNameprotected static java.lang.String guessName(java.lang.String methodname) 
 - 
guessParameterTypeprotected static java.lang.Class<?> guessParameterType(java.lang.Class<?>[] ptypes, java.lang.ClassLoader cl)
 - 
checkAndAddRequiredServiceInfopublic static void checkAndAddRequiredServiceInfo(RequiredServiceInfo rsis, java.util.Map<java.lang.String,java.lang.Object> rsers, java.lang.ClassLoader cl) - Parameters:
- rsis-
- rsers-
- cl-
 
 
- 
 
-