build method
dynamic
build()
Implementation
build() {
InstanceMirror im = reflect(this);
ClassMirror classMirror = im.type;
classMirror.declarations.forEach((key, value) {
bool nullable = false;
try {
var defaultValue = im.getField(key).reflectee;
nullable = defaultValue == null;
} catch (e) {
// NO-OP
}
String originalName = MirrorSystem.getName(key);
if (value is VariableMirror) {
Type type = value.type.reflectedType;
if (value.metadata.isNotEmpty) {
var a = value.metadata.first.reflectee;
if (a is arg) {
Arg _arg = a.toArg(originalName, type, nullable);
if (!_arg.validate()) {
// 例外
}
_specs.add(_arg);
}
}
}
});
}