public abstract class AbstractAsmBdiClassGenerator extends java.lang.Object implements IBDIClassGenerator
Modifier and Type | Field and Description |
---|---|
protected NodeHelper |
nodehelper |
protected OpcodeHelper |
ophelper |
AGENT_FIELD_NAME, DYNAMIC_BELIEF_UPDATEMETHOD_PREFIX, GLOBALNAME_FIELD_NAME, INIT_EXPRESSIONS_METHOD_PREFIX
Constructor and Description |
---|
AbstractAsmBdiClassGenerator() |
Modifier and Type | Method and Description |
---|---|
static void |
checkEnhanced(java.lang.Class<?> clazz)
Check if a bdi agent class was enhanced.
|
protected abstract void |
enhanceSetter(java.lang.String iclname,
MethodNode setter,
java.lang.String belname)
Enhance setter method with unobserve oldvalue at the beginning and event call at the end
|
abstract java.util.List<java.lang.Class<?>> |
generateBDIClass(java.lang.String clname,
BDIModel micromodel,
java.lang.ClassLoader cl)
Generate class, including inner classes.
|
protected boolean |
isAgentClass(ClassNode classNode)
Check whether a given ClassNode is an Agent (or Capability) class.
|
protected boolean |
isAgentOrCapa(java.lang.String annotationDescription)
Check whether a given Annotation marks an Agent or Capability.
|
static boolean |
isEnhanced(java.lang.Class<?> clazz)
Returns whether a class is already enhanced.
|
protected boolean |
isGoal(java.lang.String annotationDescription)
Check whether a given Annotation marks a goal.
|
protected boolean |
isPlan(java.lang.String annotationDescription)
Check whether a given Annotation marks a plan.
|
protected boolean |
isPlanClass(ClassNode classNode) |
protected boolean |
isPlanMethod(MethodNode methodNode) |
protected abstract void |
replaceNativeGetter(java.lang.String iclname,
MethodNode nativeGetter,
java.lang.String belname)
Replace native getter for abstract belief.
|
protected abstract void |
replaceNativeSetter(java.lang.String iclname,
MethodNode nativeSetter,
java.lang.String belname)
Replace native setter for abstract belief.
|
protected abstract void |
transformArrayStores(MethodNode mn,
BDIModel model,
java.lang.String iclname) |
protected void |
transformClassNode(ClassNode cn,
java.lang.String iclname,
BDIModel model) |
protected abstract void |
transformConstructor(ClassNode cn,
MethodNode mn,
BDIModel model,
java.util.List<java.lang.String> tododyn) |
protected OpcodeHelper ophelper
protected NodeHelper nodehelper
public abstract java.util.List<java.lang.Class<?>> generateBDIClass(java.lang.String clname, BDIModel micromodel, java.lang.ClassLoader cl)
IBDIClassGenerator
generateBDIClass
in interface IBDIClassGenerator
protected void transformClassNode(ClassNode cn, java.lang.String iclname, BDIModel model)
cn
- iclname
- model
- protected abstract void transformArrayStores(MethodNode mn, BDIModel model, java.lang.String iclname)
protected abstract void transformConstructor(ClassNode cn, MethodNode mn, BDIModel model, java.util.List<java.lang.String> tododyn)
cn
- the class which contains the constructormn
- The Constructor method nodemodel
- tododyn
- list of dynamic beliefsprotected abstract void replaceNativeGetter(java.lang.String iclname, MethodNode nativeGetter, java.lang.String belname)
iclname
- nativeSetter
- belname
- protected abstract void replaceNativeSetter(java.lang.String iclname, MethodNode nativeSetter, java.lang.String belname)
iclname
- nativeSetter
- belname
- protected abstract void enhanceSetter(java.lang.String iclname, MethodNode setter, java.lang.String belname)
iclname
- setter
- belname
- protected boolean isAgentClass(ClassNode classNode)
classNode
- protected boolean isAgentOrCapa(java.lang.String annotationDescription)
annotationDescription
- description of the annotationprotected boolean isGoal(java.lang.String annotationDescription)
annotationDescription
- description of the annotationprotected boolean isPlan(java.lang.String annotationDescription)
annotationDescription
- description of the annotationprotected boolean isPlanClass(ClassNode classNode)
classNode
- protected boolean isPlanMethod(MethodNode methodNode)
methodNode
- public static boolean isEnhanced(java.lang.Class<?> clazz)
clazz
- public static void checkEnhanced(java.lang.Class<?> clazz)
java.lang.RuntimeException
- if was not enhanced.