Amplication AST Libraries Documentation
    Preparing search index...

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

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    name: string
    packageName: string
    access: Access
    abstract_: boolean
    final_: boolean
    static_: boolean
    reference: ClassReference
    isNestedClass: boolean
    extends_?: ClassReference
    implements_: ClassReference[]

    Methods

    • Adds a field to the class.

      Parameters

      • field: Field

        The field to add

      Returns void

    • Adds a constructor to the class.

      Parameters

      Returns void

    • Adds a method to the class.

      Parameters

      • method: Method

        The method to add

      Returns void

    • Adds a nested class to the class.

      Parameters

      • nestedClass: Class

        The nested class to add

      Returns void

    • Adds a nested interface to the class.

      Parameters

      • nestedInterface: Interface

        The nested interface to add

      Returns void

    • Adds a nested enum to the class.

      Parameters

      • nestedEnum: Enum

        The nested enum to add

      Returns void

    • Writes the class declaration and its contents to the writer. This includes the class declaration, fields, constructors, methods, and nested types.

      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