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.
  • Field Details

  • Constructor Details

    • BDIClassReader

      public BDIClassReader(BDIModelLoader loader)
      Create a new bdi class reader.
  • Method Details

    • setGenerator

      public void setGenerator(IBDIClassGenerator gen)
      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:
      read in class jadex.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

      protected jadex.micro.MicroModel read(String model, Class<?> cma, ClassLoader cl)
      Load the model.
      Overrides:
      read in class jadex.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

      protected MTrigger buildPlanTrigger(BDIModel bdimodel, String name, Trigger trigger, ClassLoader cl, Map<jadex.common.ClassInfo,List<jadex.common.Tuple2<MGoal,String>>> pubs)
    • getServiceCall

      protected MServiceCall getServiceCall(BDIModel bdimodel, ServiceTrigger st)
    • getMPlan

      protected MPlan getMPlan(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)
    • 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

      protected MGoal getMGoal(BDIModel model, Goal goal, Class<?> gcl, ClassLoader cl, Map<jadex.common.ClassInfo,List<jadex.common.Tuple2<MGoal,String>>> pubs)
    • createMGoal

      protected MGoal createMGoal(BDIModel model, Goal goal, Class<?> gcl, ClassLoader cl, Map<jadex.common.ClassInfo,List<jadex.common.Tuple2<MGoal,String>>> pubs)
    • 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

      protected Class<?> getMicroAgentClass(String clname, String[] imports, ClassLoader classloader)
      Get the mirco agent class.
      Overrides:
      getMicroAgentClass in class jadex.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

      protected void initBDIModelAfterClassLoading(BDIModel model, ClassLoader cl)
      Do model initialization that can only be done after class reading.