如何在ArkTS中实现运行时注解的能力
===================

可以使用TS三方库reflect-metadata获得类似Java运行时注解的功能。参考[reflect-metadata](https://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/reflect-metadata#https://gitee.com/openharmony-tpc/docs/blob/master/OpenHarmony_har_usage.md)

reflect-metadata提供的装饰器允许对类、属性和方法进行标记，并提供了接口以在运行时获取这些标记信息。

import "reflect-metadata";

_// The ability of third-party packaging is exposed in Reflect_
@Reflect.metadata("TargetClass", 'classData')
 _ // Tag class, key is "targetClass", data is classData_
class MyClass {
  @Reflect.metadata("TargetMethod", 'methodData')
 _ // Tag method, key is' Target Method ', data is' methodData'_
  myMethod() {
  }

  @Reflect.metadata("Static", 'staticData')
  static invoke() {
  }
}

_// Retrieve tag information at runtime_
console.info(Reflect.getMetadata("TargetClass", MyClass)); _//classData_
console.info(Reflect.getMetadata("TargetMethod", new MyClass(), "myMethod")); _//methodData_
console.info(Reflect.getMetadata("Static", MyClass, "invoke")); _// staticData_