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

Method addClass

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

Adds a class definition to this module. If this is the first class added, its name is recorded as the main class name. The class's containing module is set to this module, and it's registered with the compile unit if present. @param node the ClassNode to add @throws SyntaxException if a cla

(final ClassNode node)

Source from the content-addressed store, hash-verified

376 * @throws SyntaxException if a class with the same name already exists in this module
377 */
378 public void addClass(final ClassNode node) {
379 if (classes.isEmpty())
380 mainClassName = node.getName();
381 classes.add(node);
382 node.setModule(this);
383 addToCompileUnit(node);
384 checkUsage(node.getNameWithoutPackage(), node);
385 }
386
387 private void addToCompileUnit(final ClassNode node) {
388 // register the new class with the compile unit

Callers 10

addClassNodeMethod · 0.95
addToCompileUnitMethod · 0.45
adjustSuperClassMethod · 0.45
createBeanInfoClassMethod · 0.45
transformClassMethod · 0.45
visitCompilationUnitMethod · 0.45

Calls 7

addToCompileUnitMethod · 0.95
checkUsageMethod · 0.95
getNameWithoutPackageMethod · 0.80
getNameMethod · 0.65
addMethod · 0.65
isEmptyMethod · 0.45
setModuleMethod · 0.45

Tested by

no test coverage detected