Amplication AST Libraries Documentation
    Preparing search index...

    Represents a Java method in the AST. This class handles the generation of Java method declarations including parameters, return type, body, and other method-related elements.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    name: string

    The name of the method

    access: Access

    The access level of the method

    Methods

    • Adds a parameter to the method.

      Parameters

      Returns void

    • Sets the method body.

      Parameters

      • body: CodeBlock

        The code block containing the method body

      Returns Method

      This Method instance for method chaining

    • Writes the method declaration and its contents to the writer. This includes JavaDoc, annotations, method signature, parameters, return type, and method body. The method handles all Java method modifiers including static, abstract, final, and synchronized.

      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