Interface JClassDef

All Superinterfaces:
JAnnotatable, JClassDefSection, JCommentable, JDocCommentable, JGenericDef
All Known Subinterfaces:
JAnonymousClassDef
All Known Implementing Classes:
AbstractJClassDef, AnnotationJClassDef, AnonymousJClassDef, EnumConstantJClassDef, EnumJClassDef, ImplJAnonymousClassDef, InnerJAnonymousClassDef, InterfaceJClassDef, PlainJClassDef

public interface JClassDef extends JAnnotatable, JDocCommentable, JGenericDef, JClassDefSection
A type definition, which can be a class, interface, annotation type, etc.
  • Method Details

    • blankLine

      JClassDef blankLine()
      Add a blank line at this point of the type.
      Specified by:
      blankLine in interface JClassDefSection
      Returns:
      this type definition
    • _extends

      JClassDef _extends(String name)
      Add an extends type to this type.
      Parameters:
      name - the type name
      Returns:
      this type definition
    • _extends

      JClassDef _extends(JType type)
      Add an extends type to this type.
      Parameters:
      type - the type
      Returns:
      this type definition
    • _extends

      JClassDef _extends(Class<?> clazz)
      Add an extends type to this type.
      Parameters:
      clazz - the type
      Returns:
      this type definition
    • _implements

      JClassDef _implements(String... name)
      Add one or more implements type(s) to this type.
      Parameters:
      name - the type name
      Returns:
      this type definition
    • _implements

      JClassDef _implements(JType... type)
      Add one or more implements type(s) to this type.
      Parameters:
      type - the type
      Returns:
      this type definition
    • _implements

      JClassDef _implements(Class<?>... clazz)
      Add one or more implements type(s) to this type.
      Parameters:
      clazz - the type
      Returns:
      this type definition
    • erasedType

      JType erasedType()
      Get the erased type corresponding to this type definition.
      Returns:
      the erased type
    • genericType

      JType genericType()
      Get a generic type for this type definition, where the type arguments are the same as the type parameters of this type (as defined at the time this method is called).
      Returns:
      the generic type
    • _enum

      JEnumConstant _enum(String name)
      Add an enum constant. If the class being defined is not an enum, an exception is thrown.
      Parameters:
      name - the constant name
      Returns:
      the call for enum construction