Amplication AST Libraries Documentation
    Preparing search index...

    Represents a Java enum in the AST. This class handles the generation of Java enum declarations including constants, fields, methods, and other enum-related elements.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    name: string

    The name of the enum

    packageName: string

    The package name of the enum

    access: Access

    The access level of the enum

    reference: ClassReference

    The class reference for this enum

    isNestedEnum: boolean

    Whether this is a nested enum

    implements_: ClassReference[]

    The interfaces implemented by this enum

    Methods

    • Adds an enum constant to the enum.

      Parameters

      • value: Value

        The enum constant to add

      Returns void

    • Adds a field to the enum.

      Parameters

      • field: Field

        The field to add

      Returns void

    • Adds a method to the enum.

      Parameters

      • method: Method

        The method to add

      Returns void

    • Sets the constructor parameters for enum constants.

      Parameters

      • parameters: string[]

        The constructor parameter types

      Returns void

    • Writes the enum declaration and its contents to the writer. This includes package declaration, JavaDoc, annotations, constants, fields, and methods.

      Parameters

      • writer: Writer

        The writer to write to

      Returns void

    • Returns the string representation of the AST node. This method creates a new Writer instance and writes the node's content to it.

      Returns string

      The string representation of the AST node