FunctionBase constructor

FunctionBase()

Implementation

FunctionBase() {
  DefineMethod annotation;
  final classMirror = reflect(this).type;
  String externalName;
  String internalName;
  FunctionRegistryItem item;
  bool listArguments;
  List<InstanceMirror> metadataList;

  for (final method in classMirror.declarations.values) {
    listArguments = false;
    externalName = internalName = MirrorSystem.getName(method.simpleName);
    metadataList = method.metadata;
    if (metadataList.isNotEmpty) {
      annotation = metadataList.first.reflectee;
      if (annotation.skip) continue;
      if (annotation.name != null) externalName = annotation.name;
      listArguments = annotation.listArguments;
    }
    item = FunctionRegistryItem(
        name: internalName, listArguments: listArguments);
    if (method is MethodMirror && !method.isConstructor) {
      registry[externalName] = item;
    }
  }
  less = TreeApi();
}