aac.context.definition

Definition class for Architecture-as-Code.

Classes

Definition(name, package, content, source[, ...])

An Architecture-as-Code definition.

class aac.context.definition.Definition(name: str, package: str, content: str, source: AaCFile, lexemes: list[Lexeme] = NOTHING, structure: dict = NOTHING, instance: Any = attr_dict['instance'].default)[source]

An Architecture-as-Code definition.

Parameters:
  • name (str)

  • package (str)

  • content (str)

  • source (AaCFile)

  • lexemes (list[Lexeme])

  • structure (dict)

  • instance (Any)

uid

A unique identifier for selecting the specific definition.

Type:

UUID

name

The name of the definition.

Type:

str

package

The package of the definition.

Type:

str

content

The original source textual representation of the definition.

Type:

str

source

The source document containing the definition.

Type:

AaCFile

lexemes

A list of lexemes for each item in the parsed definition.

Type:

list[Lexeme]

structure

The dictionary representation of the definition.

Type:

dict

instance

A Python class instance of the definition.

Type:

Any

__attrs_post_init__()[source]

Post-init hook.

__eq__(obj)[source]

Equals function for the Definition.

__hash__() int[source]

Return the hash of this Definition.

Return type:

int

get_fully_qualified_name() str[source]

Return the fully qualified name of the definition.

Return type:

str

get_python_class_name() str[source]

Return the python class name for the definition.

Return type:

str

get_python_module_name() str[source]

Return the python module name for the definition.

Return type:

str

get_root_key() str[source]

Get the root key for the definition.

Returns:

The root key for the definition.

Return type:

str

is_import() bool[source]

Return True if the definition is an import definition.

Return type:

bool

to_yaml() str[source]

Return a yaml string based on the current state of the definition including extensions.

Return type:

str