Interface JClassDefSection

All Superinterfaces:
JCommentable
All Known Subinterfaces:
JAnonymousClassDef, JClassDef
All Known Implementing Classes:
AbstractJClassDef, AnnotationJClassDef, AnonymousJClassDef, EnumConstantJClassDef, EnumJClassDef, ImplJAnonymousClassDef, InnerJAnonymousClassDef, InterfaceJClassDef, JClassDefSectionImpl, PlainJClassDef

public interface JClassDefSection extends JCommentable
A section of a class definition, to which members, comments, and blank lines may be added.
  • Method Details

    • section

      JClassDefSection section()
      Create a section at this point, into which additional items may be added.
      Returns:
      the new section to add
    • blankLine

      JClassDefSection blankLine()
      Add a blank line at this point of the type.
      Returns:
      this type definition
    • init

      JBlock init()
      Add a "raw" initialization block to this type definition.
      Returns:
      the initialization block
    • staticInit

      JBlock staticInit()
      Add a static initialization block to this type definition.
      Returns:
      the static initialization block
    • field

      JVarDeclaration field(int mods, JType type, String name)
      Add a field to this type.
      Parameters:
      mods - the modifiers
      type - the field type
      name - the field name
      Returns:
      the field declaration
    • field

      JVarDeclaration field(int mods, JType type, String name, JExpr init)
      Add a field to this type.
      Parameters:
      mods - the modifiers
      type - the field type
      name - the field name
      init - the field assigned value
      Returns:
      the field declaration
    • field

      JVarDeclaration field(int mods, Class<?> type, String name)
      Add a field to this type.
      Parameters:
      mods - the modifiers
      type - the field type
      name - the field name
      Returns:
      the field declaration
    • field

      JVarDeclaration field(int mods, Class<?> type, String name, JExpr init)
      Add a field to this type.
      Parameters:
      mods - the modifiers
      type - the field type
      name - the field name
      init - the field assigned value
      Returns:
      the field declaration
    • field

      JVarDeclaration field(int mods, String type, String name)
      Add a field to this type.
      Parameters:
      mods - the modifiers
      type - the field type
      name - the field name
      Returns:
      the field declaration
    • field

      JVarDeclaration field(int mods, String type, String name, JExpr init)
      Add a field to this type.
      Parameters:
      mods - the modifiers
      type - the field type
      name - the field name
      init - the field assigned value
      Returns:
      the field declaration
    • method

      JMethodDef method(int mods, JType returnType, String name)
      Add a method to this type.
      Parameters:
      mods - the modifiers
      returnType - the method return type
      name - the method name
      Returns:
      the method definition
    • method

      JMethodDef method(int mods, Class<?> returnType, String name)
      Add a method to this type.
      Parameters:
      mods - the modifiers
      returnType - the method return type
      name - the method name
      Returns:
      the method definition
    • method

      JMethodDef method(int mods, String returnType, String name)
      Add a method to this type.
      Parameters:
      mods - the modifiers
      returnType - the method return type
      name - the method name
      Returns:
      the method definition
    • constructor

      JMethodDef constructor(int mods)
      Add a constructor to this type.
      Parameters:
      mods - the modifiers
      Returns:
      the constructor definition
    • _class

      JClassDef _class(int mods, String name)
      Add a nested class to this type.
      Parameters:
      mods - the class modifiers
      name - the class name
      Returns:
      the nested class
    • _enum

      JClassDef _enum(int mods, String name)
      Add a nested enum to this type.
      Parameters:
      mods - the enum modifiers
      name - the enum name
      Returns:
      the nested enum
    • _interface

      JClassDef _interface(int mods, String name)
      Add a nested interface to this type.
      Parameters:
      mods - the interface modifiers
      name - the interface name
      Returns:
      the nested interface
    • annotationInterface

      JClassDef annotationInterface(int mods, String name)
      Add a nested annotation interface to this type.
      Parameters:
      mods - the annotation interface modifiers
      name - the annotation interface name
      Returns:
      the nested annotation interface