angel3_serialize_generator library

Classes

BuildContext
A base context for building serializable classes.
JsonModelGenerator
SerializableFieldMirror
SerializerGenerator
ShimFieldImpl
A manually-instantiated FieldElement.
TypeScriptDefinitionBuilder

Constants

dateTimeTypeChecker → const TypeChecker
excludeTypeChecker → const TypeChecker
generatedSerializableTypeChecker → const TypeChecker
serializableFieldTypeChecker → const TypeChecker
serializableTypeChecker → const TypeChecker

Properties

modelPrefix → List<String>
Support prefix for base serializable classes.
final
modelSuffix → List<String>
final

Functions

buildContext(InterfaceElement clazz, ConstantReader annotation, BuildStep buildStep, Resolver resolver, bool autoSnakeCaseNames, {bool heedExclude = true}) → Future<BuildContext?>
Create a BuildContext.
convertObject(DartObject o, {LibraryElement? library}) → Expression
o as an expression of the code generated in library, where a constant or a class of a library it imports with a prefix, as import 'tags.dart' as t;, has that prefix (t.Tag.a).
convertTypeReference(DartType t, {bool forceNullable = false, bool ignoreNullabilityCheck = false, LibraryElement? library}) → TypeReference
Converts a DartType to a TypeReference, as typeIn writes it in code generated in library: with the prefix of the import of its class, and its type arguments.
dartObjectToString(DartObject v) → String?
generatedClassNameOf(String clazz) → String
The name of the class generated of the model class clazz, as it is declared: getGeneratedModelClassName of it, in pascal case, as Url of _URL and UserInfo of _User_Info. Its serializer is named after it (UrlSerializer), wherever it is referred to.
getGeneratedModelClassName(String clazz) → String
The name of the class generated of the model class clazz: clazz without one of modelPrefix, and then without one of modelSuffix, so that _UserEntity, EntityUser, UserEntity and _User are all User.
isAssignableToModel(DartType type) → bool
isEnumType(DartType t) → bool
isListOfModelType(InterfaceType t) → bool
Determines if a DartType is a List with the first type argument being a Model.
isListOrMapType(DartType t) → bool
isListType(DartType t) → bool
isMapToModelType(InterfaceType t) → bool
Determines if a DartType is a Map with the second type argument being a Model.
isMapType(DartType t) → bool
isModelClass(DartType? t) → bool
Determines if a type supports package:angel3_serialize.
jsonModelBuilder(dynamic _) → Builder
modelClassNameOf(DartType type) → String
The name of the class generated of the model of type, as the model class itself is named: a class generated already (@generatedSerializable) is its own, and a model class is generatedClassNameOf its name, as it is declared: User of _UserEntity, EntityType of _EntityType, and Url of _URL.
readSerializers(ConstantReader annotation, {bool report = false}) → List<Serializers>
The Serializers enabled by a @Serializable annotation.
serializerBuilder(dynamic _) → Builder
typeIn(DartType type, [LibraryElement? library, bool question = true]) → String
type as it is written in code generated in library, with its ? if question: a class with the prefix of its import if it is of a library imported with one (t.Tag), its type arguments, and the types of a function type (void Function(t.Tag)) or a record ((int, t.Tag)) as well. A generic function type, and another type, as dynamic or a type parameter, are as the analyzer writes them.
typescriptDefinitionBuilder(dynamic _) → Builder
typeToString(DartType type, [LibraryElement? library]) → String?
Compute a String representation of a type. type as it is written in code generated in library, without its own ?, which the caller gives; its type arguments keep theirs.