Class PatternMatcher.Builder

  • Enclosing class:
    PatternMatcher

    public static class PatternMatcher.Builder
    extends java.lang.Object
    The Builder object for PatternMatcher.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • 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