ModelClassDefinition class final
A ClassDefinition specialization that represents a model class.
- Inheritance
-
- Object
- SerializableModelDefinition
- ClassDefinition
- ModelClassDefinition
Constructors
-
ModelClassDefinition.new({required String fileName, required String sourceFileName, required String className, required List<
SerializableModelFieldDefinition> fields, required bool serverOnly, required bool manageMigration, required TypeDefinition type, required bool isSealed, List<InheritanceDefinition> ? childClasses, InheritanceDefinition? extendsClass, String? tableName, List<SerializableModelIndexDefinition> indexes = const [], List<String> subDirParts = const [], List<String> ? documentation}) - Create a new ModelClassDefinition.
Properties
-
childClasses
↔ List<
InheritanceDefinition> -
If set to a List of
InheritanceDefinitions
the class is a parent class and stores the child classes.getter/setter pair - className → String
-
finalinherited
-
descendantClasses
→ List<
ModelClassDefinition> -
Returns a list of all descendant classes.
This includes all child classes and their descendants.
If the class has no child classes, an empty list is returned.
no setter
-
documentation
→ List<
String> ? -
The documentation of this class, line by line.
finalinherited
- everyParentIsSealed → bool
-
Returns
true
if all parent classes are sealed. Returnstrue
if the class does not have a parent class.no setter - extendsClass ↔ InheritanceDefinition?
-
If set to
InheritanceDefinitions
the class extends another class and stores the ClassDefinition of it's parent.getter/setter pair -
fields
↔ List<
SerializableModelFieldDefinition> -
The fields of this class / exception.
getter/setter pairinherited
-
fieldsIncludingInherited
→ List<
SerializableModelFieldDefinition> -
Returns a list of all fields in this class, including inherited fields.
It ensures that the 'id' field, if present, is always included at the beginning of the list.
no setter
- fileName → String
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- idField → SerializableModelFieldDefinition
-
Returns the
SerializableModelFieldDefinition
of the 'id' field. If the field is not present, an error is thrown.no setter -
indexes
→ List<
SerializableModelIndexDefinition> -
The indexes that should be created for the table tableName representing
this class.
final
-
inheritedFields
→ List<
SerializableModelFieldDefinition> -
Returns a list of all fields in the parent class.
If there is no parent class, an empty list is returned.
no setter
- isParentClass → bool
-
Returns
true
if this class is a parent class or sealed.no setter - isSealed → bool
-
If set to true the class is sealed.
final
- isSealedTopNode → bool
-
Returns
true
if this class is the top node of a sealed hierarchy.no setter - manageMigration → bool
-
final
- parentClass → ModelClassDefinition?
-
Returns the
ModelClassDefinition
of the parent class. If there is no parent class,null
is returned.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sealedTopNode → ClassDefinition?
-
Returns the top node of the sealed hierarchy. If the class is the top node it returns itself.
If the class is not part of a sealed hierarchy,
null
is returned.no setter - serverOnly → bool
-
finalinherited
- sourceFileName → String
-
finalinherited
-
subDirParts
→ List<
String> -
finalinherited
- tableName → String?
-
If set, the name of the table, this class should be stored in, in the
database.
final
- type → TypeDefinition
-
finalinherited
Methods
-
fileRef(
) → String -
Generate the file reference String to this file.
inherited
-
findField(
String name) → SerializableModelFieldDefinition? -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited