public final class RuleConstructor extends Object
Provides a fluent API for creating Byteman rules without needing to mess around with String concatenation.
Example:
RuleConstructor rb = RuleConstructor.createRule("myRule")
.onClass("org.jboss.byteman.ExampleClass")
.inMethod("doInterestingStuff")
.atEntry()
.ifTrue()
.doAction("myAction()");
System.out.println(rb.build());
will print:
RULE myRule
CLASS org.jboss.byteman.ExampleClass
METHOD doInterestingStuff
AT ENTRY
IF true
DO myAction()
ENDRULE
Modifier and Type | Class and Description |
---|---|
class |
RuleConstructor.ActionClause |
class |
RuleConstructor.ClassClause |
class |
RuleConstructor.ConditionClause |
class |
RuleConstructor.LocationClause |
class |
RuleConstructor.MethodClause |
Modifier and Type | Method and Description |
---|---|
String |
build()
Builds the rule defined by this instance of
RuleConstructor
and returns its representation as string. |
static RuleConstructor.ClassClause |
createRule(String ruleName)
This is where you start.
|
public static final RuleConstructor.ClassClause createRule(String ruleName)
This is where you start.
Byteman
rule builder initialization method.
ruleName
- name of rule is required to construct any rulepublic String build()
RuleConstructor
and returns its representation as string.Copyright © 2017. All rights reserved.