-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
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 No, this not work, instances also has backing field in classinstance.
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:
- this one for issue
- Generate annotations for Java classes kaitai_struct_compiler#191 -- PR for compiler
- Add annotations #23 -- PR for runtime
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels