public class RuleScript extends Object
Constructor and Description |
---|
RuleScript(String name,
String targetClass,
boolean isInterface,
boolean isOverride,
String targetMethod,
String targetHelper,
Location targetLocation,
String ruleText,
int line,
String file)
standard constructor for a rule
|
Modifier and Type | Method and Description |
---|---|
String |
getFile() |
int |
getLine() |
String |
getName() |
String |
getRuleText() |
String |
getTargetClass() |
String |
getTargetHelper() |
Location |
getTargetLocation() |
String |
getTargetMethod() |
List<Transform> |
getTransformed()
getter for list of transforms applied for this script.
|
int |
getTransformedCount()
return a count of the number of transforms applied for this script.
|
boolean |
hasTransform(Class<?> clazz)
check whether a rule has been used to transform a specific class.
|
boolean |
isDeleted()
called when indexing a script to ensure that it has not already been deleted.
|
boolean |
isInterface() |
boolean |
isOverride() |
void |
purge()
uninstall any rules associated with this script.
|
void |
recordCompile(String triggerClass,
ClassLoader loader,
boolean successful,
String detail)
record the fact that a rule has been compiled with or without success
|
boolean |
recordFailedTransform(ClassLoader loader,
String internalClassName,
Throwable th)
record the fact that an error was thrown when attempting to transform a given class using this rule script
|
boolean |
recordMethodTransform(ClassLoader loader,
String internalClassName,
String triggerMethodName,
String desc,
Rule rule)
record the fact that a trigger call has been successfully installed into bytecode associated with a specific
class and loader and a corresponding rule instance been installed
|
boolean |
recordTransform(ClassLoader loader,
String internalClassName,
String triggerMethodName,
String desc,
Rule rule,
Throwable th)
record the fact that a trigger call has failed to install into bytecode associated with a specific
class and loader
|
boolean |
setDeleted()
invoked by the scriptmanager when a rule is redefined to inhibit further transformations via this script
|
String |
toString() |
void |
writeTo(PrintWriter writer) |
public RuleScript(String name, String targetClass, boolean isInterface, boolean isOverride, String targetMethod, String targetHelper, Location targetLocation, String ruleText, int line, String file)
name
- targetClass
- isInterface
- isOverride
- targetMethod
- targetHelper
- targetLocation
- ruleText
- line
- file
- public String getName()
public String getTargetClass()
public boolean isInterface()
public String getTargetHelper()
public String getTargetMethod()
public boolean isOverride()
public Location getTargetLocation()
public String getRuleText()
public int getLine()
public String getFile()
public List<Transform> getTransformed()
public int getTransformedCount()
public boolean setDeleted()
public boolean isDeleted()
public boolean recordFailedTransform(ClassLoader loader, String internalClassName, Throwable th)
loader
- internalClassName
- public boolean recordMethodTransform(ClassLoader loader, String internalClassName, String triggerMethodName, String desc, Rule rule)
loader
- internalClassName
- public boolean recordTransform(ClassLoader loader, String internalClassName, String triggerMethodName, String desc, Rule rule, Throwable th)
loader
- the loader of the class being transformedinternalClassName
- the internal name of the class being transformedth
- throwable generated during the attempt to parse the rule text or inject code at the trigger pointpublic boolean hasTransform(Class<?> clazz)
clazz
- the class for which a transform is being sought.public void recordCompile(String triggerClass, ClassLoader loader, boolean successful, String detail)
triggerClass
- the name of the trigger class to which the rule is attachedloader
- the classloader of the trigger classsuccessful
- true if the rule compiled successfully and false if it suffered from parse,
type or compile errorspublic void purge()
public void writeTo(PrintWriter writer)
Copyright © 2013. All rights reserved.