Package org.jboss.byteman.agent
Class Location.VariableAccessLocation
java.lang.Object
org.jboss.byteman.agent.Location
org.jboss.byteman.agent.Location.AccessLocation
org.jboss.byteman.agent.Location.VariableAccessLocation
- Enclosing class:
Location
location identifying a variable access trigger point
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
flag which is true if the name is a method parameter index such as $0, $1 etc otherwise falseprivate String
the name of the variable being accessed at the point where the trigger point should be insertedFields inherited from class org.jboss.byteman.agent.Location.AccessLocation
count, flags, whenComplete
Fields inherited from class org.jboss.byteman.agent.Location
ACCESS_READ, ACCESS_WRITE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
VariableAccessLocation
(String variablename, int count, int flags, boolean whenComplete) construct a location identifying a variable read trigger point -
Method Summary
Modifier and TypeMethodDescriptionidentify the type of this locationgetRuleAdapter
(org.objectweb.asm.ClassVisitor cv, TransformContext transformContext) return an adapter which can be used to insert a trigger call in a method containing a trigger point whose position matches this locationgetRuleCheckAdapter
(org.objectweb.asm.ClassVisitor cv, TransformContext transformContext) return an adapter which can be used to check whether a method contains a trigger point whose position matches this locationtoString()
Methods inherited from class org.jboss.byteman.agent.Location.AccessLocation
create
-
Field Details
-
variableName
the name of the variable being accessed at the point where the trigger point should be inserted -
isIndex
private boolean isIndexflag which is true if the name is a method parameter index such as $0, $1 etc otherwise false
-
-
Constructor Details
-
VariableAccessLocation
construct a location identifying a variable read trigger point- Parameters:
variablename
- the name of the variable being readcount
- count identifying which access should be taken as the trigger pointflags
- bit field comprising one or other of flags ACCESS_READ and ACCESS_WRITE identifying whether this specifies field READ or WRITE operationswhenComplete
- false if the trigger should be inserted before the access is performed and true if it should be inserted after
-
-
Method Details
-
getRuleCheckAdapter
public RuleCheckAdapter getRuleCheckAdapter(org.objectweb.asm.ClassVisitor cv, TransformContext transformContext) return an adapter which can be used to check whether a method contains a trigger point whose position matches this location- Specified by:
getRuleCheckAdapter
in classLocation
- Parameters:
cv
- the current class visitortransformContext
- the current transform context- Returns:
- the required adapter
-
getRuleAdapter
public RuleTriggerAdapter getRuleAdapter(org.objectweb.asm.ClassVisitor cv, TransformContext transformContext) return an adapter which can be used to insert a trigger call in a method containing a trigger point whose position matches this location- Specified by:
getRuleAdapter
in classLocation
- Parameters:
cv
- the current class visitortransformContext
- the current transform context- Returns:
- the required adapter
-
getLocationType
Description copied from class:Location
identify the type of this location- Overrides:
getLocationType
in classLocation.AccessLocation
- Returns:
- the type of this location
-
toString
-