Class DirectivesMethod

  • All Implemented Interfaces:
    Iterable<org.xembly.Directive>

    public final class DirectivesMethod
    extends Object
    implements Iterable<org.xembly.Directive>
    Directives Method.
    Since:
    0.1
    To do:
    #534:90min Refactor DirectivesMethod class to simplify the code. Currently, the class has a lot of methods and fields. It's kind of hard to understand what this class does. We need to refactor it to make it more readable and understandable. Moreover, in many places this class uses null checks, which is not good.
    • Constructor Detail

      • DirectivesMethod

        public DirectivesMethod​(String name)
        Constructor.
        Parameters:
        name - Method name
      • DirectivesMethod

        public DirectivesMethod​(String name,
                                DirectivesMethodProperties properties)
        Constructor.
        Parameters:
        name - Method name
        properties - Method properties
      • DirectivesMethod

        public DirectivesMethod​(String name,
                                boolean counting,
                                DirectivesMethodProperties properties)
        Constructor.
        Parameters:
        name - Method name
        counting - Opcodes counting
        properties - Method properties
      • DirectivesMethod

        public DirectivesMethod​(Signature name,
                                DirectivesMethodProperties properties,
                                List<Iterable<org.xembly.Directive>> instructions,
                                List<Iterable<org.xembly.Directive>> exceptions,
                                DirectivesAnnotations annotations,
                                List<Iterable<org.xembly.Directive>> dvalue,
                                DirectivesAttributes attributes,
                                boolean counting)
        Constructor.
        Parameters:
        name - Method name
        properties - Method properties
        instructions - Method instructions
        exceptions - Method exceptions
        annotations - Method annotations
        dvalue - Annotation default value
        attributes - Method attributes
        counting - Opcodes counting
        Suppressed Checkstyle violations:
        ParameterNumberCheck (10 lines)
    • Method Detail

      • withOpcode

        public DirectivesMethod withOpcode​(int opcode,
                                           Object... operands)
        Add opcode to the directives.
        Parameters:
        opcode - Opcode
        operands - Operands
        Returns:
        This object
      • withAnnotation

        public DirectivesMethod withAnnotation​(DirectivesAnnotation annotation)
        Add annotation to the directives.
        Parameters:
        annotation - Annotation directives.
        Returns:
        This object.
      • iterator

        public Iterator<org.xembly.Directive> iterator()
        Specified by:
        iterator in interface Iterable<org.xembly.Directive>