public final class GoloModule extends GoloElement<GoloModule> implements FunctionContainer
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MODULE_INITIALIZER_FUNCTION |
static java.lang.String |
TYPE_SUBPACKAGE |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(GoloIrVisitor visitor)
Accept the visitor.
|
GoloModule |
add(GoloElement<?> element) |
void |
addFunction(GoloFunction function)
Adds a function to this container.
|
java.util.List<GoloElement<?>> |
children()
Returns a list of all the direct children of this node.
|
static GoloModule |
create(PackageAndClass name,
ReferenceTable references) |
GoloModule |
enclosingModule()
Returns the module containing this element.
|
java.util.Collection<Augmentation> |
getAugmentations() |
java.util.List<GoloFunction> |
getFunctions() |
java.util.Set<ModuleImport> |
getImports() |
PackageAndClass |
getPackageAndClass() |
ReferenceTable |
getReferenceTable() |
GoloElement<?> |
getSubtypeByName(java.lang.String name) |
PackageAndClass |
getTypesPackage() |
boolean |
hasFunctions() |
boolean |
hasMain() |
boolean |
isEmpty() |
protected void |
replaceElement(GoloElement<?> original,
GoloElement<?> newElement)
Replace a child.
|
protected GoloModule |
self() |
java.lang.String |
sourceFile() |
GoloModule |
sourceFile(java.lang.String file) |
java.lang.String |
toString() |
ancestor, ancestor, ancestorOfType, cantConvert, cantReplace, cantReplace, children, children, descendants, descendants, descendants, documentation, documentation, doesNotContain, getLocalReferenceTable, hasParent, hasPosition, makeParentOf, metadata, metadata, next, next, next, ofAST, parent, positionInSourceCode, positionInSourceCode, previous, previous, previous, replaceInParentBy, walkclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddElement, addFunctions, getFunctionpublic static final java.lang.String MODULE_INITIALIZER_FUNCTION
public static final java.lang.String TYPE_SUBPACKAGE
public static GoloModule create(PackageAndClass name, ReferenceTable references)
protected GoloModule self()
self in class GoloElement<GoloModule>public PackageAndClass getPackageAndClass()
getPackageAndClass in interface FunctionContainerpublic PackageAndClass getTypesPackage()
public java.lang.String sourceFile()
public GoloModule sourceFile(java.lang.String file)
public ReferenceTable getReferenceTable()
public GoloModule enclosingModule()
enclosingModule in class GoloElement<GoloModule>public java.util.Set<ModuleImport> getImports()
public java.util.Collection<Augmentation> getAugmentations()
public java.util.List<GoloFunction> getFunctions()
getFunctions in interface FunctionContainerpublic boolean hasFunctions()
hasFunctions in interface FunctionContainerpublic boolean hasMain()
public void addFunction(GoloFunction function)
addFunction in interface FunctionContainerpublic GoloElement<?> getSubtypeByName(java.lang.String name)
public GoloModule add(GoloElement<?> element)
public void accept(GoloIrVisitor visitor)
This method should only call the visitor visitXXXX method.
The children of this node will be visited by the
GoloElement.walk(GoloIrVisitor) method.
accept in class GoloElement<GoloModule>public java.util.List<GoloElement<?>> children()
children in class GoloElement<GoloModule>public boolean isEmpty()
protected void replaceElement(GoloElement<?> original, GoloElement<?> newElement)
Replace original with newElement if original is a child of this node
and type matches.
replaceElement in class GoloElement<GoloModule>original - the original value to replace. Must be a child of this nodenewElement - the element to replace with. Type must match.GoloElement.cantReplace(),
GoloElement.cantReplace(GoloElement, GoloElement),
GoloElement.doesNotContain(GoloElement),
GoloElement.cantConvert(String, Object)public java.lang.String toString()
toString in class java.lang.Object