Class JClassDefSectionImpl

java.lang.Object
org.jboss.jdeparser.JClassDefSectionImpl
All Implemented Interfaces:
ClassContent, JClassDefSection, JCommentable, Writable

class JClassDefSectionImpl extends Object implements JClassDefSection, ClassContent
  • Field Details

  • Constructor Details

    • JClassDefSectionImpl

      JClassDefSectionImpl(Sectionable sectionable)
  • Method Details

    • add

      <C extends ClassContent> C add(C item)
    • section

      public JClassDefSection section()
      Description copied from interface: JClassDefSection
      Create a section at this point, into which additional items may be added.
      Specified by:
      section in interface JClassDefSection
      Returns:
      the new section to add
    • blankLine

      public JClassDefSection blankLine()
      Description copied from interface: JClassDefSection
      Add a blank line at this point of the type.
      Specified by:
      blankLine in interface JClassDefSection
      Returns:
      this type definition
    • 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, 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, 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, Class<?> type, 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, Class<?> type, 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, String type, 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, String type, 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, 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, Class<?> returnType, 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, String returnType, 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, 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, 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, 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, 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
    • lineComment

      public JComment lineComment()
      Description copied from interface: JCommentable
      Add a line comment.
      Specified by:
      lineComment in interface JCommentable
      Returns:
      the line comment body
    • blockComment

      public JComment blockComment()
      Description copied from interface: JCommentable
      Add a block comment.
      Specified by:
      blockComment in interface JCommentable
      Returns:
      the block comment body
    • write

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