Package jadex.bdiv3
Class AbstractAsmBdiClassGenerator
- java.lang.Object
- 
- jadex.bdiv3.AbstractAsmBdiClassGenerator
 
- 
- All Implemented Interfaces:
- IBDIClassGenerator
 - Direct Known Subclasses:
- ASMBDIClassGenerator
 
 public abstract class AbstractAsmBdiClassGenerator extends java.lang.Object implements IBDIClassGenerator ASM Generator base class
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classAbstractAsmBdiClassGenerator.MethodBeliefsStore which beliefs are accessed in a method.
 - 
Field SummaryFields Modifier and Type Field Description protected NodeHelpernodehelperprotected OpcodeHelperophelper- 
Fields inherited from interface jadex.bdiv3.IBDIClassGeneratorAGENT_FIELD_NAME, DYNAMIC_BELIEF_UPDATEMETHOD_PREFIX, GLOBALNAME_FIELD_NAME, INIT_EXPRESSIONS_METHOD_PREFIX
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractAsmBdiClassGenerator()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddBeliefEventsToConditions(org.objectweb.asm.tree.ClassNode cn, java.lang.ClassLoader dummycl, java.util.List<MCondition> conditions, MultiCollection<java.lang.String,AbstractAsmBdiClassGenerator.MethodBeliefs> methodbeliefs, MultiCollection<java.lang.String,AbstractAsmBdiClassGenerator.MethodBeliefs> methodparams, BDIModel model)static voidcheckEnhanced(java.lang.Class<?> clazz)Check if a bdi agent class was enhanced.protected abstract voidenhanceSetter(java.lang.String iclname, org.objectweb.asm.tree.MethodNode setter, java.lang.String belname)Enhance setter method with unobserve oldvalue at the beginning and event call at the endprotected abstract java.util.Set<java.lang.String>findBeliefs(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, java.util.Map<java.lang.String,org.objectweb.asm.tree.ClassNode> others)Find the beliefs used in a method.protected AbstractAsmBdiClassGenerator.MethodBeliefsfindMethodBelief(java.util.Collection<AbstractAsmBdiClassGenerator.MethodBeliefs> mbs, java.lang.reflect.Method m, java.lang.reflect.Constructor<?> c)protected abstract java.util.Set<java.lang.String>findParameters(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, java.util.Map<java.lang.String,org.objectweb.asm.tree.ClassNode> others, MGoal mgoal)Find the beliefs used in a method.abstract java.util.List<java.lang.Class<?>>generateBDIClass(java.lang.String clname, BDIModel micromodel, java.lang.ClassLoader cl)Generate class, including inner classes.protected MGoalgetGoal(org.objectweb.asm.tree.ClassNode cn, BDIModel model, java.lang.ClassLoader cl)Get a goal per class node.protected booleanisAgentClass(org.objectweb.asm.tree.ClassNode classNode)Check whether a given ClassNode is an Agent (or Capability) class.protected booleanisAgentOrCapa(java.lang.String annotationDescription)Check whether a given Annotation marks an Agent or Capability.static booleanisEnhanced(SClassReader.ClassFileInfo clazzfileinfo)Returns whether a class is already enhanced.static booleanisEnhanced(java.lang.Class<?> clazz)Returns whether a class is already enhanced.protected booleanisGoal(java.lang.String annotationDescription)Check whether a given Annotation marks a goal.protected booleanisGoalClass(org.objectweb.asm.tree.ClassNode classNode)protected booleanisPlan(java.lang.String annotationDescription)Check whether a given Annotation marks a plan.protected booleanisPlanClass(org.objectweb.asm.tree.ClassNode classNode)protected booleanisPlanMethod(org.objectweb.asm.tree.MethodNode methodNode)protected abstract voidreplaceNativeGetter(java.lang.String iclname, org.objectweb.asm.tree.MethodNode nativeGetter, java.lang.String belname)Replace native getter for abstract belief.protected abstract voidreplaceNativeSetter(java.lang.String iclname, org.objectweb.asm.tree.MethodNode nativeSetter, java.lang.String belname)Replace native setter for abstract belief.protected abstract voidtransformArrayStores(org.objectweb.asm.tree.MethodNode mn, BDIModel model, java.lang.String iclname)protected voidtransformClassNode(org.objectweb.asm.tree.ClassNode cn, java.lang.String iclname, BDIModel model, java.lang.ClassLoader dummycl, java.util.Map<java.lang.String,org.objectweb.asm.tree.ClassNode> others)protected abstract voidtransformConstructor(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, java.util.List<java.lang.String> tododyn, java.util.Map<java.lang.String,org.objectweb.asm.tree.ClassNode> others)
 
- 
- 
- 
Field Detail- 
ophelperprotected OpcodeHelper ophelper 
 - 
nodehelperprotected NodeHelper nodehelper 
 
- 
 - 
Method Detail- 
generateBDIClasspublic abstract java.util.List<java.lang.Class<?>> generateBDIClass(java.lang.String clname, BDIModel micromodel, java.lang.ClassLoader cl) throws JadexBDIGenerationExceptionDescription copied from interface:IBDIClassGeneratorGenerate class, including inner classes.- Specified by:
- generateBDIClassin interface- IBDIClassGenerator
- Returns:
- the List of classes generated.
- Throws:
- JadexBDIGenerationException
 
 - 
transformClassNodeprotected void transformClassNode(org.objectweb.asm.tree.ClassNode cn, java.lang.String iclname, BDIModel model, java.lang.ClassLoader dummycl, java.util.Map<java.lang.String,org.objectweb.asm.tree.ClassNode> others)- Parameters:
- cn-
- iclname-
- model-
 
 - 
getGoalprotected MGoal getGoal(org.objectweb.asm.tree.ClassNode cn, BDIModel model, java.lang.ClassLoader cl) Get a goal per class node.- Parameters:
- cn-
- Returns:
 
 - 
addBeliefEventsToConditionsprotected void addBeliefEventsToConditions(org.objectweb.asm.tree.ClassNode cn, java.lang.ClassLoader dummycl, java.util.List<MCondition> conditions, MultiCollection<java.lang.String,AbstractAsmBdiClassGenerator.MethodBeliefs> methodbeliefs, MultiCollection<java.lang.String,AbstractAsmBdiClassGenerator.MethodBeliefs> methodparams, BDIModel model)- Parameters:
- cn-
- dummycl-
- conditions-
- methodbeliefs-
- model-
 
 - 
findMethodBeliefprotected AbstractAsmBdiClassGenerator.MethodBeliefs findMethodBelief(java.util.Collection<AbstractAsmBdiClassGenerator.MethodBeliefs> mbs, java.lang.reflect.Method m, java.lang.reflect.Constructor<?> c) - Parameters:
- mbs-
- m-
- c-
- Returns:
 
 - 
transformArrayStoresprotected abstract void transformArrayStores(org.objectweb.asm.tree.MethodNode mn, BDIModel model, java.lang.String iclname)
 - 
transformConstructorprotected abstract void transformConstructor(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, java.util.List<java.lang.String> tododyn, java.util.Map<java.lang.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
 
 - 
replaceNativeGetterprotected abstract void replaceNativeGetter(java.lang.String iclname, org.objectweb.asm.tree.MethodNode nativeGetter, java.lang.String belname)Replace native getter for abstract belief.- Parameters:
- iclname-
- nativeSetter-
- belname-
 
 - 
replaceNativeSetterprotected abstract void replaceNativeSetter(java.lang.String iclname, org.objectweb.asm.tree.MethodNode nativeSetter, java.lang.String belname)Replace native setter for abstract belief.- Parameters:
- iclname-
- nativeSetter-
- belname-
 
 - 
enhanceSetterprotected abstract void enhanceSetter(java.lang.String iclname, org.objectweb.asm.tree.MethodNode setter, java.lang.String belname)Enhance setter method with unobserve oldvalue at the beginning and event call at the end- Parameters:
- iclname-
- setter-
- belname-
 
 - 
findBeliefsprotected abstract java.util.Set<java.lang.String> findBeliefs(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, java.util.Map<java.lang.String,org.objectweb.asm.tree.ClassNode> others)Find the beliefs used in a method.
 - 
findParametersprotected abstract java.util.Set<java.lang.String> findParameters(org.objectweb.asm.tree.ClassNode cn, org.objectweb.asm.tree.MethodNode mn, BDIModel model, java.util.Map<java.lang.String,org.objectweb.asm.tree.ClassNode> others, MGoal mgoal)Find the beliefs used in a method.
 - 
isAgentClassprotected 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.
 
 - 
isAgentOrCapaprotected boolean isAgentOrCapa(java.lang.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.
 
 - 
isGoalprotected boolean isGoal(java.lang.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.
 
 - 
isPlanprotected boolean isPlan(java.lang.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.
 
 - 
isPlanClassprotected boolean isPlanClass(org.objectweb.asm.tree.ClassNode classNode) - Parameters:
- classNode-
- Returns:
 
 - 
isGoalClassprotected boolean isGoalClass(org.objectweb.asm.tree.ClassNode classNode) - Parameters:
- classNode-
- Returns:
 
 - 
isPlanMethodprotected boolean isPlanMethod(org.objectweb.asm.tree.MethodNode methodNode) - Parameters:
- methodNode-
- Returns:
 
 - 
isEnhancedpublic static boolean isEnhanced(java.lang.Class<?> clazz) Returns whether a class is already enhanced.- Parameters:
- clazz-
- Returns:
- true, if already enhanced, else false.
 
 - 
isEnhancedpublic static boolean isEnhanced(SClassReader.ClassFileInfo clazzfileinfo) Returns whether a class is already enhanced.- Parameters:
- clazz- The clazz info.
- Returns:
- true, if already enhanced, else false.
 
 - 
checkEnhancedpublic static void checkEnhanced(java.lang.Class<?> clazz) Check if a bdi agent class was enhanced.- Throws:
- java.lang.RuntimeException- if was not enhanced.
 
 
- 
 
-