Class AbstractJMethodDef

    • Constructor Detail

    • Method Detail

      • _default

        public JBlock _default()
        Description copied from interface: JMethodDef
        A default method body for a JDK 8+ interface method.
        Specified by:
        _default in interface JMethodDef
        Returns:
        the method body
      • _default

        public JMethodDef _default​(JExpr expr)
        Description copied from interface: JMethodDef
        A default value for an annotation method.
        Specified by:
        _default in interface JMethodDef
        Parameters:
        expr - the value
        Returns:
        this method definition
      • body

        public JBlock body()
        Description copied from interface: JMethodDef
        Get the method body.
        Specified by:
        body in interface JMethodDef
        Returns:
        the method body
      • returnsDoc

        public JComment returnsDoc()
        Description copied from interface: JMethodDef
        Get the @return doc comment block.
        Specified by:
        returnsDoc in interface JMethodDef
        Returns:
        the comment block
      • param

        public JParamDeclaration param​(int mods,
                                       JType type,
                                       java.lang.String name)
        Description copied from interface: JMethodDef
        Add a parameter to this method.
        Specified by:
        param in interface JMethodDef
        Parameters:
        mods - the parameter modifiers
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • param

        public JParamDeclaration param​(JType type,
                                       java.lang.String name)
        Description copied from interface: JMethodDef
        Add a parameter to this method.
        Specified by:
        param in interface JMethodDef
        Parameters:
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • param

        public JParamDeclaration param​(int mods,
                                       java.lang.String type,
                                       java.lang.String name)
        Description copied from interface: JMethodDef
        Add a parameter to this method.
        Specified by:
        param in interface JMethodDef
        Parameters:
        mods - the parameter modifiers
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • param

        public JParamDeclaration param​(java.lang.String type,
                                       java.lang.String name)
        Description copied from interface: JMethodDef
        Add a parameter to this method.
        Specified by:
        param in interface JMethodDef
        Parameters:
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • param

        public JParamDeclaration param​(int mods,
                                       java.lang.Class<?> type,
                                       java.lang.String name)
        Description copied from interface: JMethodDef
        Add a parameter to this method.
        Specified by:
        param in interface JMethodDef
        Parameters:
        mods - the parameter modifiers
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • param

        public JParamDeclaration param​(java.lang.Class<?> type,
                                       java.lang.String name)
        Description copied from interface: JMethodDef
        Add a parameter to this method.
        Specified by:
        param in interface JMethodDef
        Parameters:
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • varargParam

        public JParamDeclaration varargParam​(int mods,
                                             JType type,
                                             java.lang.String name)
        Description copied from interface: JMethodDef
        Add a vararg parameter to this method.
        Specified by:
        varargParam in interface JMethodDef
        Parameters:
        mods - the parameter modifiers
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • varargParam

        public JParamDeclaration varargParam​(JType type,
                                             java.lang.String name)
        Description copied from interface: JMethodDef
        Add a vararg parameter to this method.
        Specified by:
        varargParam in interface JMethodDef
        Parameters:
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • varargParam

        public JParamDeclaration varargParam​(int mods,
                                             java.lang.String type,
                                             java.lang.String name)
        Description copied from interface: JMethodDef
        Add a vararg parameter to this method.
        Specified by:
        varargParam in interface JMethodDef
        Parameters:
        mods - the parameter modifiers
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • varargParam

        public JParamDeclaration varargParam​(java.lang.String type,
                                             java.lang.String name)
        Description copied from interface: JMethodDef
        Add a vararg parameter to this method.
        Specified by:
        varargParam in interface JMethodDef
        Parameters:
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • varargParam

        public JParamDeclaration varargParam​(int mods,
                                             java.lang.Class<?> type,
                                             java.lang.String name)
        Description copied from interface: JMethodDef
        Add a vararg parameter to this method.
        Specified by:
        varargParam in interface JMethodDef
        Parameters:
        mods - the parameter modifiers
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • varargParam

        public JParamDeclaration varargParam​(java.lang.Class<?> type,
                                             java.lang.String name)
        Description copied from interface: JMethodDef
        Add a vararg parameter to this method.
        Specified by:
        varargParam in interface JMethodDef
        Parameters:
        type - the parameter type
        name - the parameter name
        Returns:
        the parameter declaration
      • _throws

        public JComment _throws​(java.lang.String type)
        Description copied from interface: JMethodDef
        Get a @throws doc comment block.
        Specified by:
        _throws in interface JMethodDef
        Parameters:
        type - the exception type
        Returns:
        the doc comment block
      • _throws

        public JComment _throws​(JType type)
        Description copied from interface: JMethodDef
        Get a @throws doc comment block.
        Specified by:
        _throws in interface JMethodDef
        Parameters:
        type - the exception type
        Returns:
        the doc comment block
      • _throws

        public JComment _throws​(java.lang.Class<? extends java.lang.Throwable> type)
        Description copied from interface: JMethodDef
        Get a @throws doc comment block.
        Specified by:
        _throws in interface JMethodDef
        Parameters:
        type - the exception type
        Returns:
        the doc comment block
      • getModifiers

        int getModifiers()
      • writeBody

        boolean writeBody()
      • write

        public void write​(SourceFileWriter writer)
                   throws java.io.IOException
        Specified by:
        write in interface Writable
        Throws:
        java.io.IOException
      • writePostfix

        void writePostfix​(SourceFileWriter writer)
                   throws java.io.IOException
        Throws:
        java.io.IOException