If you want to build visualizer, you must rely on that fact, that internal fields begins with underscore. You can use the static field _seqFields to distinguish between parameters and structure fields. To distinguish between parameters and instances of the structure, you can see that there is a field with the same name, as getter method. If there is no field, it is an instance. No, this not work, instances also has backing field in class
But all these methods are fragile. I suggest introduce 3 annotations instead:
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Parameter {
String doc();// documentation
}
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Field {
String doc();// documentation
}
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Instance {
String doc();// documentation
}
List of all related issues/PRs:
If you want to build visualizer, you must rely on that fact, that internal fields begins with underscore. You can use the static field
_seqFieldsto distinguish between parameters and structure fields.To distinguish between parameters and instances of the structure, you can see that there is a field with the same name, as getter method. If there is no field, it is anNo, this not work, instances also has backing field in classinstance.But all these methods are fragile. I suggest introduce 3 annotations instead:
List of all related issues/PRs: