java.lang.Object
io.helidon.codegen.classmodel.ClassBase
io.helidon.codegen.classmodel.ClassModel

public final class ClassModel extends ClassBase
Entry point to create class model. This model contain all needed information for each generated type and handles resulting generation.

The following types are supported (through ClassBase.Builder.classType(io.helidon.common.types.ElementKind)):

  • Field Details

    • PADDING_TOKEN

      public static final String PADDING_TOKEN
      Padding token used for identifying extra padding requirement for content formatting.
      See Also:
    • TYPE_TOKEN

      public static final String TYPE_TOKEN
      Type token is used to prepend and append to the fully qualified type names to support import handling.
      See Also:
    • TYPE_TOKEN_PATTERN

      public static final String TYPE_TOKEN_PATTERN
      Pattern in which are type names saved in the content templates.
      See Also:
    • DEFAULT_PADDING

      public static final String DEFAULT_PADDING
      Default padding used in the generated type.
      See Also:
  • Method Details

    • builder

      public static ClassModel.Builder builder()
      Create new ClassModel.Builder instance.
      Returns:
      new builder instance
    • write

      public void write(Writer writer) throws IOException
      Write created type model. Default padding DEFAULT_PADDING is used.
      Parameters:
      writer - writer to be used
      Throws:
      IOException - write operation failure
    • write

      public void write(Writer writer, String padding) throws IOException
      Write created type model.
      Parameters:
      writer - writer to be used
      padding - padding to be used
      Throws:
      IOException - write operation failure
    • typeName

      public TypeName typeName()
      Type name of this class.
      Returns:
      type name
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • annotations

      public List<Annotation> annotations()
      List of annotations on this component.
      Returns:
      annotations
    • name

      public String name()
      Name of this component.
      Returns:
      component name
    • accessModifier

      public AccessModifier accessModifier()
      Access modifier of this component.
      Returns:
      access modifier
    • description

      public List<String> description()
      Description (javadoc) of this component.
      Returns:
      description lines