Skip to content

Instantly share code, notes, and snippets.

@hron84
Last active December 11, 2015 22:08
Show Gist options
  • Save hron84/4667373 to your computer and use it in GitHub Desktop.
Save hron84/4667373 to your computer and use it in GitHub Desktop.
dir = {
klazz = null;
// So ugly hack. It is needed because some Groovy
// objects hides its getClass methods (like hashes)
if(it instanceof Class) {
klazz = it;
} else {
g = it.&getClass;
klazz = g();
}
constructs = Arrays.asList(klazz.constructors)
methods = Arrays.asList(klazz.methods).sort { it.name.toLowerCase() }
println " ==== ${klazz} ====\n";
if(constructs.empty) {
println "// No constructors";
} else {
for(c in constructs) {
println c;
}
}
println "";
for(m in methods) {
println m;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment