public class TransformContext extends Object
Constructor | Description |
---|---|
TransformContext(Transformer transformer,
RuleScript ruleScript,
String triggerClassName,
ClassLoader loader,
HelperManager helperManager,
AccessEnabler accessEnabler) |
Modifier and Type | Method | Description |
---|---|---|
Rule |
createRule(String triggerMethodName,
String triggerMethodDescriptor) |
called by a check adapter to create a rule specific to a given trigger method.
|
void |
fail(String failMessage,
String triggerMethodName,
String triggerMethodDescriptor) |
called by a check or trigger adapter to fail a transform because of a type issue.
|
String |
findLeastCommonSuper(String t1,
String t2) |
|
String |
getTriggerClassName() |
|
boolean |
injectIntoMethod(String name,
String desc) |
|
Rule |
lookupRule(String triggerMethodName,
String triggerMethodDescriptor) |
called by a trigger adapter to find a rule specific to a given trigger method,
expects to find a rule created by the corresponding check adapter.
|
boolean |
matchTargetMethod(int access,
String name,
String desc) |
|
void |
parseRule() |
|
void |
recordFailedTransform(Throwable th) |
|
byte[] |
transform(byte[] targetClassBytes) |
|
void |
warn(String triggerMethodName,
String triggerMethodDescriptor,
String warningMessage) |
called by a check adapter to warn that a transform was not possible for a potential match
target.
|
public static final String TOFU
public TransformContext(Transformer transformer, RuleScript ruleScript, String triggerClassName, ClassLoader loader, HelperManager helperManager, AccessEnabler accessEnabler)
public byte[] transform(byte[] targetClassBytes)
public Rule lookupRule(String triggerMethodName, String triggerMethodDescriptor)
triggerMethodName
- the name of a candidate method for injectiontriggerMethodDescriptor
- the descriptor of a candidate method for injectionpublic Rule createRule(String triggerMethodName, String triggerMethodDescriptor)
triggerMethodName
- the name of a candidate method for injectiontriggerMethodDescriptor
- the descriptor of a candidate method for injectionpublic void warn(String triggerMethodName, String triggerMethodDescriptor, String warningMessage)
triggerMethodName
- the name of a candidate method for injectiontriggerMethodDescriptor
- the descriptor of a candidate method for injectionwarningMessage
- details of the warningpublic void fail(String failMessage, String triggerMethodName, String triggerMethodDescriptor)
failMessage
- details of the failuretriggerMethodName
- the name of a candidate method for injectiontriggerMethodDescriptor
- the descriptor of a candidate method for injectionpublic void recordFailedTransform(Throwable th)
public String getTriggerClassName()
Copyright © 2018. All rights reserved.