Class AbstractAsmBdiClassGenerator

java.lang.Object
jadex.bdi.model.AbstractAsmBdiClassGenerator
All Implemented Interfaces:
IBDIClassGenerator
Direct Known Subclasses:
ASMBDIClassGenerator

public abstract class AbstractAsmBdiClassGenerator extends Object implements IBDIClassGenerator
ASM Generator base class
  • Field Details

  • Constructor Details

    • AbstractAsmBdiClassGenerator

      public AbstractAsmBdiClassGenerator()
  • Method Details

    • generateBDIClass

      public abstract List<Class<?>> generateBDIClass(String clname, BDIModel micromodel, ClassLoader cl) throws JadexBDIGenerationException
      Description copied from interface: IBDIClassGenerator
      Generate class, including inner classes.
      Specified by:
      generateBDIClass in interface IBDIClassGenerator
      Returns:
      the List of classes generated.
      Throws:
      JadexBDIGenerationException
    • transformClassNode

      protected void transformClassNode(org.objectweb.asm.tree.ClassNode cn, String iclname, BDIModel model, ClassLoader dummycl, Map<String,org.objectweb.asm.tree.ClassNode> others)
      Parameters:
      cn -
      iclname -
      model -
    • getGoal

      protected MGoal getGoal(org.objectweb.asm.tree.ClassNode cn, BDIModel model, ClassLoader cl)
      Get a goal per class node.
      Parameters:
      cn -
      Returns:
    • addBeliefEventsToConditions

      protected void addBeliefEventsToConditions(org.objectweb.asm.tree.ClassNode cn, ClassLoader dummycl, List<MCondition> conditions, jadex.collection.MultiCollection<String,AbstractAsmBdiClassGenerator.MethodBeliefs> methodbeliefs, jadex.collection.MultiCollection<String,AbstractAsmBdiClassGenerator.MethodBeliefs> methodparams, BDIModel model)
      Parameters:
      cn -
      dummycl -
      conditions -
      methodbeliefs -
      model -
    • findMethodBelief

      Parameters:
      mbs -
      m -
      c -
      Returns:
    • transformArrayStores

      protected abstract void transformArrayStores(org.objectweb.asm.tree.MethodNode mn, BDIModel model, String iclname)
    • transformConstructor

      protected abstract void transformConstructor(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, List<String> tododyn, Map<String,org.objectweb.asm.tree.ClassNode> others)
      Parameters:
      cn - the class which contains the constructor
      mn - The Constructor method node
      model -
      tododyn - list of dynamic beliefs
    • replaceNativeGetter

      protected abstract void replaceNativeGetter(String iclname, org.objectweb.asm.tree.MethodNode nativeGetter, String belname)
      Replace native getter for abstract belief.
      Parameters:
      iclname -
      belname -
      nativeSetter -
    • replaceNativeSetter

      protected abstract void replaceNativeSetter(String iclname, org.objectweb.asm.tree.MethodNode nativeSetter, String belname)
      Replace native setter for abstract belief.
      Parameters:
      iclname -
      nativeSetter -
      belname -
    • enhanceSetter

      protected abstract void enhanceSetter(String iclname, org.objectweb.asm.tree.MethodNode setter, String belname)
      Enhance setter method with unobserve oldvalue at the beginning and event call at the end
      Parameters:
      iclname -
      setter -
      belname -
    • findBeliefs

      protected abstract Set<String> findBeliefs(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, Map<String,org.objectweb.asm.tree.ClassNode> others)
      Find the beliefs used in a method.
    • findParameters

      protected abstract Set<String> findParameters(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, Map<String,org.objectweb.asm.tree.ClassNode> others, MGoal mgoal)
      Find the beliefs used in a method.
    • isAgentClass

      protected boolean isAgentClass(org.objectweb.asm.tree.ClassNode classNode)
      Check whether a given ClassNode is an Agent (or Capability) class.
      Parameters:
      classNode -
      Returns:
      true, if the given classNode is an Agent or Capability class.
    • isAgentOrCapa

      protected boolean isAgentOrCapa(String annotationDescription)
      Check whether a given Annotation marks an Agent or Capability.
      Parameters:
      annotationDescription - description of the annotation
      Returns:
      true, if the given annotationDescription marks an Agent or Capability class.
    • isGoal

      protected boolean isGoal(String annotationDescription)
      Check whether a given Annotation marks a goal.
      Parameters:
      annotationDescription - description of the annotation
      Returns:
      true, if the given annotationDescription marks a goal.
    • isPlan

      protected boolean isPlan(String annotationDescription)
      Check whether a given Annotation marks a plan.
      Parameters:
      annotationDescription - description of the annotation
      Returns:
      true, if the given annotationDescription marks a plan.
    • isPlanClass

      protected boolean isPlanClass(org.objectweb.asm.tree.ClassNode classNode)
      Parameters:
      classNode -
      Returns:
    • isGoalClass

      protected boolean isGoalClass(org.objectweb.asm.tree.ClassNode classNode)
      Parameters:
      classNode -
      Returns:
    • isPlanMethod

      protected boolean isPlanMethod(org.objectweb.asm.tree.MethodNode methodNode)
      Parameters:
      methodNode -
      Returns: