Class RuleConstructor.LocationClause
- Enclosing class:
RuleConstructor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRule is invokedAFTER
point which is specified with parameter.afterInvoke
(String method) Rule is invoked after invocation of method within the trigger method.afterInvoke
(String method, int occurencePosition) Rule is invoked after invocation of method within the trigger method whereoccurencePosition
definesNth
textual occurrence of the method invocation.Rule is invoked after point where method reads a variable.Rule is invoked after point where method reads a variable whereoccurencePosition
definesNth
textual occurrence of the field access.Rule is invoked after invocation of method within the trigger method.
Location specifier is set asAFTER SYNCHRONIZE
.afterSynchronize
(int occurencePosition) Rule is invoked after invocation of method within the trigger method whereoccurencePosition
definesNth
textual occurrence of the method invocation.afterWrite
(String variable) Rule is invoked after point where method writes to a variable.afterWrite
(String variable, int occurencePosition) Rule is invoked after point where method writes to a variable whereoccurencePosition
definesNth
textual occurrence of the field write.Rule is invokedAT
point which is specified with parameter.atEntry()
Rule is invoked at entry point of method.Identifies the point where a method returns control back to its caller via unhandled exceptional control flow.atExit()
Rule is invoked at exit point of method.Rule is invoked at point of invocation of method within the trigger method.Rule is invoked at point of invocation of method within the trigger method whereoccurencePosition
definesNth
textual occurrence of the method invocation.atLine
(int line) Rule is invoked at specific line of code within the method.Rule is invoked at point where method reads a variable.Rule is invoked at point where method reads a variable whereoccurencePosition
definesNth
textual occurrence of the field access.Rule is invoked at entry of synchronization block in the target method.atSynchronize
(int occurencePosition) Rule is invoked at point of invocation of method within the trigger method whereoccurencePosition
definesNth
textual occurrence of the method invocation.atThrow()
Identifies a throw operation within the trigger method.atThrow
(int occurencePosition) Identifies a throw operation within the trigger method, specified with count as Nth textual occurrence of a throw inside of the method defining only that occurrence to trigger execution of the rule.Rule is invoked at point where method writes to a variable.Rule is invoked at point where method writes to a variable whereoccurencePosition
definesNth
textual occurrence of the field write.Byteman helper class to be used in rule definition.Class name of Byteman helper class.(package private) RuleConstructor.ConditionClause
Location specifier definition.
-
Constructor Details
-
LocationClause
public LocationClause()
-
-
Method Details
-
helper
Byteman helper class to be used in rule definition.- Parameters:
helperClass
- byteman helper class- Returns:
- this, for having fluent api
-
helper
Class name of Byteman helper class.- Parameters:
helperClassName
- byteman helper class name- Returns:
- this, for having fluent api
-
atEntry
Rule is invoked at entry point of method.
Location specifier is set as
AT ENTRY
.- Returns:
- this, for having fluent api
-
atExit
Rule is invoked at exit point of method.
Location specifier is set as
AT EXIT
.- Returns:
- this, for having fluent api
-
atLine
Rule is invoked at specific line of code within the method.
Location specifier is set as
AT LINE <line>
.- Parameters:
line
- line number to be rule injection point- Returns:
- this, for having fluent api
-
atRead
Rule is invoked at point where method reads a variable.
Location specifier is set as
AT READ <variable>
.- Parameters:
variable
- rule is triggered at write from this variable happen- Returns:
- this, for having fluent api
-
atRead
Rule is invoked at point where method reads a variable where
occurencePosition
definesNth
textual occurrence of the field access.Location specifier is set as
AT READ <variable> <occurencePosition>
.- Parameters:
variable
- rule is triggered at write from this variable happenoccurencePosition
- Nth textual occurrence of reading the field- Returns:
- this, for having fluent api
-
afterRead
Rule is invoked after point where method reads a variable.
Location specifier is set as
AFTER READ <variable>
.- Parameters:
variable
- rule is triggered after write from this variable happen- Returns:
- this, for having fluent api
-
afterRead
Rule is invoked after point where method reads a variable where
occurencePosition
definesNth
textual occurrence of the field access.Location specifier is set as
AFTER READ <variable> <occurencePosition>
.- Parameters:
variable
- rule is triggered after write from this variable happenoccurencePosition
- Nth textual occurrence of reading the field- Returns:
- this, for having fluent api
-
atWrite
Rule is invoked at point where method writes to a variable.
Location specifier is set as
AT WRITE <variable>
.- Parameters:
variable
- rule is triggered at write to this variable happen- Returns:
- this, for having fluent api
-
atWrite
Rule is invoked at point where method writes to a variable where
occurencePosition
definesNth
textual occurrence of the field write.Location specifier is set as
AT WRITE <variable> <occurencePosition>
.- Parameters:
variable
- rule is triggered at write to this variable happenoccurencePosition
- Nth textual occurrence of the field write- Returns:
- this, for having fluent api
-
afterWrite
Rule is invoked after point where method writes to a variable.
Location specifier is set as
AFTER WRITE <variable>
.- Parameters:
variable
- rule is triggered after write to this variable happen- Returns:
- this, for having fluent api
-
afterWrite
Rule is invoked after point where method writes to a variable where
occurencePosition
definesNth
textual occurrence of the field write.Location specifier is set as
AFTER WRITE <variable> <occurencePosition>
.- Parameters:
variable
- rule is triggered after write to this variable happenoccurencePosition
- Nth textual occurrence of the field write- Returns:
- this, for having fluent api
-
atInvoke
Rule is invoked at point of invocation of method within the trigger method.
Location specifier is set as
AT INVOKE <variable>
.- Parameters:
method
- method name after which invocation the rule is executed- Returns:
- this, for having fluent api
-
atInvoke
Rule is invoked at point of invocation of method within the trigger method where
occurencePosition
definesNth
textual occurrence of the method invocation.Location specifier is set as
AT INVOKE <variable> <occurencePosition>
.- Parameters:
method
- method name after which invocation the rule is executedoccurencePosition
- Nth textual occurrence of the method invocation- Returns:
- this, for having fluent api
-
afterInvoke
Rule is invoked after invocation of method within the trigger method.
Location specifier is set as
AFTER INVOKE <variable>
.- Parameters:
method
- method name after which invocation the rule is executed- Returns:
- this, for having fluent api
-
afterInvoke
Rule is invoked after invocation of method within the trigger method where
occurencePosition
definesNth
textual occurrence of the method invocation.Location specifier is set as
AFTER INVOKE <variable> <occurencePosition>
.- Parameters:
method
- method name after which invocation the rule is executedoccurencePosition
- Nth textual occurrence of the method invocation- Returns:
- this, for having fluent api
-
atSynchronize
Rule is invoked at entry of synchronization block in the target method.
Location specifier is set as
AT SYNCHRONIZE
.- Returns:
- this, for having fluent api
-
atSynchronize
Rule is invoked at point of invocation of method within the trigger method where
occurencePosition
definesNth
textual occurrence of the method invocation.Location specifier is set as
AT SYNCHRONIZE <occurencePosition>
.- Parameters:
occurencePosition
- Nth textual occurrence of the method invocation- Returns:
- this, for having fluent api
-
afterSynchronize
Rule is invoked after invocation of method within the trigger method.
Location specifier is set asAFTER SYNCHRONIZE
.- Returns:
- this, for having fluent api
-
afterSynchronize
Rule is invoked after invocation of method within the trigger method where
occurencePosition
definesNth
textual occurrence of the method invocation.Location specifier is set as
AFTER SYNCHRONIZE <occurencePosition>
.- Parameters:
occurencePosition
- Nth textual occurrence of the method invocation- Returns:
- this, for having fluent api
-
atThrow
Identifies a throw operation within the trigger method.
Location specifier is set as
AT THROW
.- Returns:
- this, for having fluent api
-
atThrow
Identifies a throw operation within the trigger method, specified with count as Nth textual occurrence of a throw inside of the method defining only that occurrence to trigger execution of the rule.
Location specifier is set as
AT THROW <occurencePosition>
.- Parameters:
occurencePosition
- which Nth textual occurrence of a throw triggers the rule- Returns:
- this, for having fluent api
-
atExceptionExit
Identifies the point where a method returns control back to its caller via unhandled exceptional control flow.
Location specifier is set as
AT EXCEPTION EXIT
.- Returns:
- this, for having fluent api
-
at
Rule is invoked
AT
point which is specified with parameter.Location specifier is predefined with
AT
keyword and the rest is up to parameter you provide.When you provide
LINE 123
as parameter the location specifier is set asAT LINE 123
.- Parameters:
at
- specifying rule injection point that is enriched withAT
keyword- Returns:
- this, for having fluent api
-
after
Rule is invoked
AFTER
point which is specified with parameter.Location specifier is predefined with
AFTER
keyword and the rest is up to parameter you provide.When you provide
READ $0
as parameter the location specifier is set asAFTER READ $0
.- Parameters:
after
- specifying rule injection point that is enriched withAFTER
keyword- Returns:
- this, for having fluent api
-
where
Location specifier definition.
Defined string is directly used in rule definition.
The parameter is expected to be defined as whole location specifier. For example when you provide
AT LINE 123
as parameter the location specifier is set asAT LINE 123
.- Parameters:
where
- location specifier- Returns:
- this, for having fluent api
-