Skip to content

Add annotations to field getters, param getters and instance getters #22

@Mingun

Description

@Mingun

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions