Class JClassDefSectionImpl

    • Field Detail

      • content

        private final java.util.ArrayList<ClassContent> content
    • Constructor Detail

      • JClassDefSectionImpl

        JClassDefSectionImpl​(Sectionable sectionable)
    • Method Detail

      • init

        public JBlock init()
        Description copied from interface: JClassDefSection
        Add a "raw" initialization block to this type definition.
        Specified by:
        init in interface JClassDefSection
        Returns:
        the initialization block
      • staticInit

        public JBlock staticInit()
        Description copied from interface: JClassDefSection
        Add a static initialization block to this type definition.
        Specified by:
        staticInit in interface JClassDefSection
        Returns:
        the static initialization block
      • field

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

        public JVarDeclaration field​(int mods,
                                     JType type,
                                     java.lang.String name,
                                     JExpr init)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        init - the field assigned value
        Returns:
        the field declaration
      • field

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

        public JVarDeclaration field​(int mods,
                                     java.lang.Class<?> type,
                                     java.lang.String name,
                                     JExpr init)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        init - the field assigned value
        Returns:
        the field declaration
      • field

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

        public JVarDeclaration field​(int mods,
                                     java.lang.String type,
                                     java.lang.String name,
                                     JExpr init)
        Description copied from interface: JClassDefSection
        Add a field to this type.
        Specified by:
        field in interface JClassDefSection
        Parameters:
        mods - the modifiers
        type - the field type
        name - the field name
        init - the field assigned value
        Returns:
        the field declaration
      • method

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

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

        public JMethodDef method​(int mods,
                                 java.lang.String returnType,
                                 java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a method to this type.
        Specified by:
        method in interface JClassDefSection
        Parameters:
        mods - the modifiers
        returnType - the method return type
        name - the method name
        Returns:
        the method definition
      • constructor

        public JMethodDef constructor​(int mods)
        Description copied from interface: JClassDefSection
        Add a constructor to this type.
        Specified by:
        constructor in interface JClassDefSection
        Parameters:
        mods - the modifiers
        Returns:
        the constructor definition
      • _class

        public JClassDef _class​(int mods,
                                java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a nested class to this type.
        Specified by:
        _class in interface JClassDefSection
        Parameters:
        mods - the class modifiers
        name - the class name
        Returns:
        the nested class
      • _enum

        public JClassDef _enum​(int mods,
                               java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a nested enum to this type.
        Specified by:
        _enum in interface JClassDefSection
        Parameters:
        mods - the enum modifiers
        name - the enum name
        Returns:
        the nested enum
      • _interface

        public JClassDef _interface​(int mods,
                                    java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a nested interface to this type.
        Specified by:
        _interface in interface JClassDefSection
        Parameters:
        mods - the interface modifiers
        name - the interface name
        Returns:
        the nested interface
      • annotationInterface

        public JClassDef annotationInterface​(int mods,
                                             java.lang.String name)
        Description copied from interface: JClassDefSection
        Add a nested annotation interface to this type.
        Specified by:
        annotationInterface in interface JClassDefSection
        Parameters:
        mods - the annotation interface modifiers
        name - the annotation interface name
        Returns:
        the nested annotation interface
      • write

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