ArkTSGenerator class

arkts code generator

Inheritance

Constructors

ArkTSGenerator()
Instantiates a ArkTS Generator.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generate(ArkTSOptions generatorOptions, Root root, StringSink sink, {required String dartPackageName}) → void
Generates files for specified language with specified generatorOptions
inherited
getSafeConstructorArgument(String argument) String
arkts方法参数如果是arguments,会与参数关键字冲突
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
writeApis(ArkTSOptions generatorOptions, Root root, Indent indent, {required String dartPackageName}) → void
Writes all apis to indent.
override
writeClassDecode(ArkTSOptions generatorOptions, Root root, Indent indent, Class klass, Set<String> customClassNames, Set<String> customEnumNames, {required String dartPackageName}) → void
编写dataclass的fromlist方法 fromList(arr: Object[]):Class { let instance: Class = new Class(arr0 as xxx,arr1 as xxx); return instance; }
override
writeClassEncode(ArkTSOptions generatorOptions, Root root, Indent indent, Class klass, Set<String> customClassNames, Set<String> customEnumNames, {required String dartPackageName}) → void
编写dataclass的tolist()方法 toList(): Object[]{ let arr: Object[] = new Array(); arr.push(field1); arr.push(field2); return arr; }
override
writeCloseNamespace(ArkTSOptions generatorOptions, Root root, Indent indent, {required String dartPackageName}) → void
Writes code to indent that closes file namespace if needed.
inherited
writeDataClass(ArkTSOptions generatorOptions, Root root, Indent indent, Class klass, {required String dartPackageName}) → void
Writes a single data class to indent.
override
writeDataClasses(ArkTSOptions generatorOptions, Root root, Indent indent, {required String dartPackageName}) → void
Writes all data classes to indent.
inherited
writeEnum(ArkTSOptions generatorOptions, Root root, Indent indent, Enum anEnum, {required String dartPackageName}) → void
输出枚举
override
writeEnums(ArkTSOptions generatorOptions, Root root, Indent indent, {required String dartPackageName}) → void
Writes all enums to indent.
inherited
writeFileImports(ArkTSOptions generatorOptions, Root root, Indent indent, {required String dartPackageName}) → void
Writes specified imports to indent.
override
writeFilePrologue(ArkTSOptions generatorOptions, Root root, Indent indent, {required String dartPackageName}) → void
Adds specified headers to indent.
override
writeFlutterApi(ArkTSOptions generatorOptions, Root root, Indent indent, Api api, {required String dartPackageName}) → void
Writes a single Flutter Api to indent.
override
writeGeneralUtilities(ArkTSOptions generatorOptions, Root root, Indent indent, {required String dartPackageName}) → void
Writes any necessary helper utilities to indent if needed.
override
writeHostApi(ArkTSOptions generatorOptions, Root root, Indent indent, Api api, {required String dartPackageName}) → void
Writes a single Host Api to indent.
override
writeOpenNamespace(ArkTSOptions generatorOptions, Root root, Indent indent, {required String dartPackageName}) → void
Writes code to indent that opens file namespace if needed.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited