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
()
| 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. |