Fix doc generation for field configs

And for read-only configs
This commit is contained in:
Norbi Peti 2020-08-27 16:48:56 +02:00
parent 8f610c9935
commit b89391f84c
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56

View file

@ -52,11 +52,16 @@ public class ConfigProcessor {
System.out.println("Type: "+e.getClass()+" - "+e.getKind()); System.out.println("Type: "+e.getClass()+" - "+e.getKind());
if(e instanceof ExecutableElement) if(e instanceof ExecutableElement)
System.out.println("METHOD!");*/ System.out.println("METHOD!");*/
if (!(e instanceof ExecutableElement)) continue; TypeMirror tm;
TypeMirror tm = ((ExecutableElement) e).getReturnType(); if (e instanceof ExecutableElement)
tm = ((ExecutableElement) e).getReturnType();
else if (e.getKind().isField())
tm = e.asType();
else
continue;
if (tm.getKind() != TypeKind.DECLARED) continue; if (tm.getKind() != TypeKind.DECLARED) continue;
DeclaredType dt = (DeclaredType) tm; DeclaredType dt = (DeclaredType) tm;
if (!dt.asElement().getSimpleName().contentEquals("ConfigData")) if (!dt.asElement().getSimpleName().toString().contains("ConfigData"))
continue; //Ahhha! There was a return here! (MinecraftChatModule getListener()) continue; //Ahhha! There was a return here! (MinecraftChatModule getListener())
System.out.println("Config: " + e.getSimpleName()); System.out.println("Config: " + e.getSimpleName());