MCPcopy Index your code
hub / github.com/apache/groovy / getClasses

Method getClasses

src/main/java/org/codehaus/groovy/ast/ModuleNode.java:115–125  ·  view source on GitHub ↗

Returns the module's class definitions. If createClassForStatements is true and there are module-level statements, methods, or this is a package-info script, a synthetic class is created to wrap them. This class is automatically inserted at the beginning of the list. The flag is then reset t

()

Source from the content-addressed store, hash-verified

113 * @return list of {@link ClassNode} definitions (may include synthetic wrapper for statements)
114 */
115 public List<ClassNode> getClasses() {
116 if (createClassForStatements && (!statementBlock.isEmpty() || !methods.isEmpty() || isPackageInfo())) {
117 ClassNode mainClass = createStatementsClass();
118 mainClassName = mainClass.getName();
119 createClassForStatements = false;
120 classes.add(0, mainClass);
121 mainClass.setModule(this);
122 addToCompileUnit(mainClass);
123 }
124 return /*Collections.unmodifiableList(*/classes/*)*/; // modified by MacroClassTransform
125 }
126
127 /**
128 * Returns the module's top-level method definitions.

Callers 15

visitMethod · 0.95
visitMethod · 0.95
parseGroovyMethod · 0.95
testStatementClassMethod · 0.95
createClassMethod · 0.95
resolveFromModuleMethod · 0.95
callMethod · 0.95
sortClassesMethod · 0.95
startMethod · 0.95

Calls 7

isPackageInfoMethod · 0.95
createStatementsClassMethod · 0.95
getNameMethod · 0.95
setModuleMethod · 0.95
addToCompileUnitMethod · 0.95
addMethod · 0.65
isEmptyMethod · 0.45

Tested by 4

testStatementClassMethod · 0.76