generator_tools
library
Classes
-
Describes how to format a document comment.
-
EnumeratedType
-
A type name that is enumerated.
-
HostDatatype
-
Represents the mapping of a Dart datatype to a Host datatype.
-
Indent
-
A helper class for managing indentation, wrapping a StringSink.
-
Keys
-
Collection of keys used in dictionaries across generators.
-
OutputFileOptions<T>
-
Options for Generators that have multiple output file types.
Enums
-
ApiType
-
Enum to specify api type when generating code.
-
CustomTypes
-
All custom definable data types.
-
FileType
-
Enum to specify which file will be generated for multi-file generators
Functions
-
Formats documentation comments and adds them to current Indent.
-
addLines(Indent indent, Iterable<String> lines, {String? linePrefix})
→ void
-
Adds the
lines
to indent
.
-
Formats documentation comments and adds them to current Indent.
-
customTypeOverflowCheck(Root root)
→ bool
-
Checks if
root
contains enough custom types to require overflow codec tools.
-
deducePackageName(String mainDartFile)
→ String?
-
Given the path of a Dart file,
mainDartFile
, the name of the package will
be deduced by locating and parsing its associated pubspec.yaml.
-
findHighestApiRequirement<T extends Object>(Iterable<TypeDeclaration> types, {required T? onGetApiRequirement(TypeDeclaration), required Comparator<T> onCompare})
→ ({TypeDeclaration type, T version})?
-
Find the TypeDeclaration that has the highest API requirement and its
version,
T
.
-
getEnumeratedTypes(Root root, {bool excludeSealedClasses = false})
→ Iterable<EnumeratedType>
-
Return the enumerated types that must exist in the codec
where the enumeration should be the key used in the buffer.
-
getFieldHostDatatype(NamedType field, String? builtinResolver(TypeDeclaration), {String customResolver(String)?})
→ HostDatatype
-
Calculates the HostDatatype for the provided NamedType.
-
getFieldsInSerializationOrder(Class classDefinition)
→ Iterable<NamedType>
-
Returns an ordered list of fields to provide consistent serialization order.
-
getGeneratedCodeWarning()
→ String
-
Warning printed at the top of all generated code.
-
getHostDatatype(TypeDeclaration type, String? builtinResolver(TypeDeclaration), {String customResolver(String)?})
→ HostDatatype
-
Calculates the HostDatatype for the provided TypeDeclaration.
-
getReferencedTypes(List<Api> apis, List<Class> classes)
→ Map<TypeDeclaration, List<int>>
-
Recurses into a list of Apis and produces a list of all referenced types
and an associated List of the offsets where they are found.
-
isVoid(TypeMirror type)
→ bool
-
Returns true if
type
represents 'void'.
-
makeChannelName(Api api, Method method, String dartPackageName)
→ String
-
Create the generated channel name for a
method
on an api
.
-
makeChannelNameWithStrings({required String apiName, required String methodName, required String dartPackageName})
→ String
-
Create the generated channel name for a method on an api.
-
makeClearChannelName(String dartPackageName)
→ String
-
The channel name for the
clear
method of the InstanceManager
API.
-
makeRemoveStrongReferenceChannelName(String dartPackageName)
→ String
-
The channel name for the
removeStrongReference
method of the
InstanceManager
API.
-
mergeMaps(Map<String, Object> base, Map<String, Object> modification)
→ Map<String, Object>
-
Recursively merges
modification
into base
.
-
readStdin()
→ String
-
Read all the content from stdin to a String.
-
toLowerCamelCase(String text)
→ String
-
Converts strings to Lower Camel Case.
-
toScreamingSnakeCase(String string)
→ String
-
Converts string to SCREAMING_SNAKE_CASE.
-
toUpperCamelCase(String text)
→ String
-
Converts strings to Upper Camel Case.