Set default fields and change kind strings

This commit is contained in:
naofal.helal
2025-03-26 16:36:28 +03:00
parent c67a91e22a
commit b386142752
2 changed files with 11 additions and 10 deletions

View File

@@ -15,7 +15,8 @@ public class Jtags {
boolean absolutePaths = false;
boolean excludeNonPublic = false;
boolean excludeAnonymous = false;
List<Class<? extends TagField>> fields = new ArrayList<>();
List<Class<? extends TagField>> fields =
List.of(TagField.StaticTag.class, TagField.Package.class, TagField.EnclosingType.class);
}
public static void main(String[] args) {

View File

@@ -53,15 +53,15 @@ public record TagsWriter(Options options) {
writer.write("$/;\"\t");
writer.write(
switch (tag.kind()) {
case PACKAGE -> 'P';
case CLASS -> 'C';
case RECORD -> 'R';
case INTERFACE -> 'I';
case ANNOTATION -> 'A';
case ENUM -> 'E';
case FIELD -> 'f';
case ENUM_CONSTANT -> 'e';
case METHOD -> 'm';
case PACKAGE -> "Pkg";
case CLASS -> "Cls";
case RECORD -> "Rcrd";
case INTERFACE -> "Intf";
case ANNOTATION -> "Anno";
case ENUM -> "Enum";
case FIELD -> "fld";
case ENUM_CONSTANT -> "enum";
case METHOD -> "mthd";
});
for (TagField field : tag.fields()) {