Class GeneratedCodeMethod

    • Method Detail

      • getModifiers

        public int getModifiers()
        Description copied from interface: CodeMethod
        Get the modifiers, such as PUBLIC, ABSTRACT and so on
        Specified by:
        getModifiers in interface CodeMethod
        Returns:
        the class modifiers
      • getParameterType

        public CodeClass getParameterType​(int pos)
        Description copied from interface: CodeMethod
        Get the type of the parameter at a given position
        Specified by:
        getParameterType in interface CodeMethod
        Parameters:
        pos - the position to fetch the parameter type for
        Returns:
        the type of the parameter at that position
      • getVariable

        public LocalVariable getVariable​(int pos)
        Gets the Variable attribute of the GeneratedCodeMethod object.

        There is one local variable for each of the arguments of the method, indexed from 0.

        Parameters:
        pos - the index of the local variable
        Returns:
        the local variable
      • getVariable

        public LocalVariable getVariable​(String argName)
                                  throws NoSuchElementException
        Gets the Variable attribute of the GenerateCodeMethod object by name.

        All methods have a variable under the string "this". If it was constructed with a String [] naming the args, the locals for each local can be retrieved by name.

        Parameters:
        argName - a String naming the local
        Returns:
        the LocalVariable for that argName
        Throws:
        NoSuchElementException - if there is no local with that name
      • getThis

        public LocalVariable getThis()
        Gets the This attribute of the GeneratedCodeMethod object
        Returns:
        The This value
      • getThrownExceptions

        public Set getThrownExceptions()
        Gets the ThrownExceptions attribute of the GeneratedCodeMethod object
        Returns:
        The ThrownExceptions value
      • addThrownException

        public void addThrownException​(CodeClass cc)
        Adds a feature to the ThrownException attribute of the GeneratedCodeMethod object
        Parameters:
        cc - The feature to be added to the ThrownException attribute