Package jadex.bdi.model
Class BDIClassReader
java.lang.Object
jadex.micro.MicroClassReader
jadex.bdi.model.BDIClassReader
public class BDIClassReader
extends jadex.micro.MicroClassReader
Reads micro agent classes and generates a model from metainfo and annotations.
-
Nested Class Summary
Nested classes/interfaces inherited from class jadex.micro.MicroClassReader
jadex.micro.MicroClassReader.DummyClassLoader -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IBDIClassGeneratorThe class generator.protected BDIModelLoaderThe model loader for subcapabilities. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MTriggerbuildPlanTrigger(BDIModel bdimodel, String name, Trigger trigger, ClassLoader cl, Map<jadex.common.ClassInfo, List<jadex.common.Tuple2<MGoal, String>>> pubs) protected List<MConfigBeliefElement> createConfigBeliefsList(jadex.model.annotation.NameValue[] values) Create config beliefs.protected List<MConfigParameterElement> createConfigParamElementsList(jadex.model.annotation.NameValue[] values) Create config parameter elements.protected jadex.micro.MicroClassReader.DummyClassLoadercreateDummyClassLoader(ClassLoader original, ClassLoader parent, List<URL> urls) Create a throw away class loader.protected MConditioncreateMethodCondition(MParameterElement mpelem, String condtype, String[] evs, RawEvent[] rawevs, String[] paramevs, BDIModel model, Method m, ClassLoader cl) protected MGoalcreateMGoal(BDIModel model, Goal goal, Class<?> gcl, ClassLoader cl, Map<jadex.common.ClassInfo, List<jadex.common.Tuple2<MGoal, String>>> pubs) protected MPlancreateMPlan(BDIModel bdimodel, Plan p, jadex.common.MethodInfo mi, String name, jadex.common.ClassInfo ci, ClassLoader cl, Map<jadex.common.ClassInfo, List<jadex.common.Tuple2<MGoal, String>>> pubs, int order) Create a plan model.protected voidfillBDIModelFromAnnotations(BDIModel bdimodel, String model, Class<?> cma, ClassLoader cl) Fill the model details using annotation.protected MGoalgetMGoal(BDIModel model, Goal goal, Class<?> gcl, ClassLoader cl, Map<jadex.common.ClassInfo, List<jadex.common.Tuple2<MGoal, String>>> pubs) protected Class<?> getMicroAgentClass(String clname, String[] imports, ClassLoader classloader) Get the mirco agent class.protected MPlangetMPlan(BDIModel bdimodel, Plan p, jadex.common.MethodInfo mi, jadex.common.ClassInfo ci, ClassLoader cl, Map<jadex.common.ClassInfo, List<jadex.common.Tuple2<MGoal, String>>> pubs, int order) protected MServiceCallgetServiceCall(BDIModel bdimodel, ServiceTrigger st) protected voidinitBDIModelAfterClassLoading(BDIModel model, ClassLoader cl) Do model initialization that can only be done after class reading.protected jadex.micro.MicroModelread(String model, Class<?> cma, ClassLoader cl) Load the model.jadex.micro.MicroModelread(String model, Object pojo, String[] imports, ClassLoader classloader) Load a model.static List<jadex.rules.eca.EventType> readAnnotationEvents(MCapability capa, Annotation[][] annos, ClassLoader cl) Read the annotation events from method annotations.voidSet the generator.Methods inherited from class jadex.micro.MicroClassReader
checkMethodReturnType, convertNameValue, createComponentInstanceInfo, createComponentInstanceInfo, createUnparsedExpressions, createUnparsedExpressions, createUnparsedExpressionsList, evaluateExpression, fillMicroModelFromAnnotations, findInjections, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotations, getClass, getClassArray, getOrCreateList, getOrCreateMap, getOrCreateSet, getParameterAnnotations, getParameterAnnotations, getProxyAnnotation, guessName, isAnnotationPresent, isAnnotationPresent, isAnnotationPresent, isAnnotationPresent, isClassLoaderCompatible
-
Field Details
-
gen
The class generator. -
loader
The model loader for subcapabilities.
-
-
Constructor Details
-
BDIClassReader
Create a new bdi class reader.
-
-
Method Details
-
setGenerator
Set the generator.- Parameters:
gen- the gen to set
-
read
public jadex.micro.MicroModel read(String model, Object pojo, String[] imports, ClassLoader classloader) Load a model.- Overrides:
readin classjadex.micro.MicroClassReader- Parameters:
model- The model (e.g. file name).imports- (if any).- Returns:
- The loaded model.
-
createDummyClassLoader
protected jadex.micro.MicroClassReader.DummyClassLoader createDummyClassLoader(ClassLoader original, ClassLoader parent, List<URL> urls) Create a throw away class loader. -
read
Load the model.- Overrides:
readin classjadex.micro.MicroClassReader
-
fillBDIModelFromAnnotations
protected void fillBDIModelFromAnnotations(BDIModel bdimodel, String model, Class<?> cma, ClassLoader cl) Fill the model details using annotation. // called with dummy classloader (that was used to load cma first time) -
buildPlanTrigger
-
getServiceCall
-
getMPlan
-
createMPlan
protected MPlan createMPlan(BDIModel bdimodel, Plan p, jadex.common.MethodInfo mi, String name, jadex.common.ClassInfo ci, ClassLoader cl, Map<jadex.common.ClassInfo, List<jadex.common.Tuple2<MGoal, String>>> pubs, int order) Create a plan model. -
getMGoal
-
createMGoal
-
createMethodCondition
protected MCondition createMethodCondition(MParameterElement mpelem, String condtype, String[] evs, RawEvent[] rawevs, String[] paramevs, BDIModel model, Method m, ClassLoader cl) -
readAnnotationEvents
public static List<jadex.rules.eca.EventType> readAnnotationEvents(MCapability capa, Annotation[][] annos, ClassLoader cl) Read the annotation events from method annotations. -
getMicroAgentClass
Get the mirco agent class.- Overrides:
getMicroAgentClassin classjadex.micro.MicroClassReader
-
createConfigBeliefsList
protected List<MConfigBeliefElement> createConfigBeliefsList(jadex.model.annotation.NameValue[] values) Create config beliefs. -
createConfigParamElementsList
protected List<MConfigParameterElement> createConfigParamElementsList(jadex.model.annotation.NameValue[] values) Create config parameter elements. -
initBDIModelAfterClassLoading
Do model initialization that can only be done after class reading.
-