Package ftbsc.lll.utils
Class PatternMatcher.Builder
- java.lang.Object
-
- ftbsc.lll.utils.PatternMatcher.Builder
-
- Enclosing class:
- PatternMatcher
public static class PatternMatcher.Builder extends java.lang.Object
The Builder object forPatternMatcher
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatternMatcher.Builder
any()
Wildcard, matches any kind of node.PatternMatcher
build()
Builds the pattern defined so far.PatternMatcher.Builder
check(java.util.function.Predicate<org.objectweb.asm.tree.AbstractInsnNode> predicate)
Adds a custom predicate to the list.PatternMatcher.Builder
field()
Matches a field invokation of any kind: one of GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.PatternMatcher.Builder
ignoreFrames()
Tells the pattern matcher to ignore FRAME instructions.PatternMatcher.Builder
ignoreLabels()
Tells the pattern matcher to ignore LABEL instructions.PatternMatcher.Builder
ignoreLineNumbers()
Tells the pattern matcher to ignore LINENUMBER instructions.PatternMatcher.Builder
jump()
Matches any kind of jump instruction.PatternMatcher.Builder
label()
Matches any kind of label.PatternMatcher.Builder
method()
Matches a method invokation of any kind: one of INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.PatternMatcher.Builder
opcode(int opcode)
Matches a specific opcode.PatternMatcher.Builder
opcodes(int... opcodes)
Matches a list of opcodes.PatternMatcher.Builder
reverse()
Sets the pattern to match starting from the end.
-
-
-
Method Detail
-
build
public PatternMatcher build()
Builds the pattern defined so far.- Returns:
- the built
PatternMatcher
-
reverse
public PatternMatcher.Builder reverse()
Sets the pattern to match starting from the end.- Returns:
- the builder's state after the operation
-
check
public PatternMatcher.Builder check(java.util.function.Predicate<org.objectweb.asm.tree.AbstractInsnNode> predicate)
Adds a custom predicate to the list. Also used internally.- Parameters:
predicate
- the predicate to add- Returns:
- the builder's state after the operation
-
any
public PatternMatcher.Builder any()
Wildcard, matches any kind of node.- Returns:
- the builder's state after the operation
-
opcode
public PatternMatcher.Builder opcode(int opcode)
Matches a specific opcode.- Parameters:
opcode
- opcode to match- Returns:
- the builder's state after the operation
-
opcodes
public PatternMatcher.Builder opcodes(int... opcodes)
Matches a list of opcodes.- Parameters:
opcodes
- list of opcodes to match- Returns:
- the builder's state after the operation
-
method
public PatternMatcher.Builder method()
Matches a method invokation of any kind: one of INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.- Returns:
- the builder's state after the operation
-
field
public PatternMatcher.Builder field()
Matches a field invokation of any kind: one of GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.- Returns:
- the builder's state after the operation
-
jump
public PatternMatcher.Builder jump()
Matches any kind of jump instruction.- Returns:
- the builder's state after the operation
-
label
public PatternMatcher.Builder label()
Matches any kind of label.- Returns:
- the builder's state after the operation
-
ignoreLabels
public PatternMatcher.Builder ignoreLabels()
Tells the pattern matcher to ignore LABEL instructions.- Returns:
- the builder's state after the operation
-
ignoreFrames
public PatternMatcher.Builder ignoreFrames()
Tells the pattern matcher to ignore FRAME instructions.- Returns:
- the builder's state after the operation
-
ignoreLineNumbers
public PatternMatcher.Builder ignoreLineNumbers()
Tells the pattern matcher to ignore LINENUMBER instructions.- Returns:
- the builder's state after the operation
-
-