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)
| 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 |
no test coverage detected