Amplication AST Libraries Documentation
    Preparing search index...

    Represents a Python class definition in the AST. This class handles the generation of Python class declarations including methods, attributes, and nested classes.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    name: string

    The name of the class

    moduleName?: string

    The module name containing the class

    The parent classes to inherit from

    decorators: Decorator[]

    The decorators applied to the class

    docstring?: string

    The documentation string for the class

    reference: ClassReference

    The class reference for this class

    Methods

    • Adds a method to the class.

      Parameters

      Returns void

    • Adds an attribute to the class.

      Parameters

      • attribute: Assign

        The attribute to add

      Returns void

    • Adds a nested class to this class.

      Parameters

      • nestedClass: ClassDef

        The nested class to add

      Returns void

    • Adds a code block for unsupported features.

      Parameters

      Returns void

    • Writes the class definition and its members to the writer.

      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