Class CtModuleImpl
java.lang.Object
spoon.support.reflect.declaration.CtElementImpl
spoon.support.reflect.declaration.CtNamedElementImpl
spoon.support.reflect.declaration.CtModuleImpl
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,SourcePositionHolder
,CtElement
,CtModule
,CtNamedElement
,CtQueryable
,CtVisitable
- Direct Known Subclasses:
ModuleFactory.CtUnnamedModule
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class spoon.support.reflect.declaration.CtElementImpl
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
Fields inherited from interface spoon.reflect.declaration.CtModule
TOP_LEVEL_MODULE_NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts a visitor<T extends CtModule>
TaddExportedPackage(CtPackageExport exportedPackage)
<T extends CtModule>
TaddModuleDirective(CtModuleDirective moduleDirective)
<T extends CtModule>
TaddModuleDirectiveAt(int position, CtModuleDirective moduleDirective)
<T extends CtModule>
TaddOpenedPackage(CtPackageExport openedPackage)
<T extends CtModule>
TaddProvidedService(CtProvidedService providedService)
<T extends CtModule>
TaddRequiredModule(CtModuleRequirement requiredModule)
<T extends CtModule>
TaddUsedService(CtUsedService consumedService)
clone()
Clone the element which calls this method in a new object.Gets the parent of current reference.Returns the corresponding reference.returns the root package of the unnamed module If there are several modules, it throws an exceptionboolean
boolean
Returns true if the module is the unnamed module<T extends CtModule>
TremoveExportedPackage(CtPackageExport exportedPackage)
<T extends CtModule>
TremoveModuleDirective(CtModuleDirective moduleDirective)
<T extends CtModule>
TremoveOpenedPackage(CtPackageExport openedPackage)
<T extends CtModule>
TremoveProvidedService(CtProvidedService providedService)
<T extends CtModule>
TremoveRequiredModule(CtModuleRequirement requiredModule)
<T extends CtModule>
TremoveUsedService(CtUsedService usedService)
<T extends CtModule>
TsetExportedPackages(List<CtPackageExport> exportedPackages)
<T extends CtModule>
TsetIsOpenModule(boolean openModule)
<T extends CtModule>
TsetModuleDirectives(List<CtModuleDirective> moduleDirectives)
<T extends CtModule>
TsetOpenedPackages(List<CtPackageExport> openedPackages)
<T extends CtElement>
TManually sets the parent element of the current element.<T extends CtModule>
TsetProvidedServices(List<CtProvidedService> providedServices)
<T extends CtModule>
TsetRequiredModules(List<CtModuleRequirement> requiredModules)
<T extends CtModule>
TsetRootPackage(CtPackage rootPackage)
<T extends CtModule>
TsetUsedServices(List<CtUsedService> consumedServices)
Methods inherited from class spoon.support.reflect.declaration.CtNamedElementImpl
getSimpleName, setSimpleName
Methods inherited from class spoon.support.reflect.declaration.CtElementImpl
addAnnotation, addComment, asIterable, comment, delete, descendantIterator, emptyList, emptySet, equals, filterChildren, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getFactory, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hashCode, hasParent, isImplicit, isParentInitialized, map, map, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setFactory, setImplicit, setPosition, setPositions, setValueByRole, toString, toStringDebug, unmodifiableList, updateAllParentsBelow
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface spoon.reflect.declaration.CtElement
addAnnotation, addComment, asIterable, delete, descendantIterator, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setComments, setDocComment, setImplicit, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
Methods inherited from interface spoon.reflect.declaration.CtNamedElement
getSimpleName, setSimpleName
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Constructor Details
-
CtModuleImpl
public CtModuleImpl()
-
-
Method Details
-
isUnnamedModule
public boolean isUnnamedModule()Description copied from interface:CtModule
Returns true if the module is the unnamed module- Specified by:
isUnnamedModule
in interfaceCtModule
-
isOpenModule
public boolean isOpenModule()- Specified by:
isOpenModule
in interfaceCtModule
-
setModuleDirectives
- Specified by:
setModuleDirectives
in interfaceCtModule
-
addModuleDirective
- Specified by:
addModuleDirective
in interfaceCtModule
-
addModuleDirectiveAt
public <T extends CtModule> T addModuleDirectiveAt(int position, CtModuleDirective moduleDirective)- Specified by:
addModuleDirectiveAt
in interfaceCtModule
-
getModuleDirectives
- Specified by:
getModuleDirectives
in interfaceCtModule
-
removeModuleDirective
- Specified by:
removeModuleDirective
in interfaceCtModule
-
setIsOpenModule
- Specified by:
setIsOpenModule
in interfaceCtModule
-
getUsedServices
- Specified by:
getUsedServices
in interfaceCtModule
-
setUsedServices
- Specified by:
setUsedServices
in interfaceCtModule
-
addUsedService
- Specified by:
addUsedService
in interfaceCtModule
-
removeUsedService
- Specified by:
removeUsedService
in interfaceCtModule
-
getExportedPackages
- Specified by:
getExportedPackages
in interfaceCtModule
-
setExportedPackages
- Specified by:
setExportedPackages
in interfaceCtModule
-
addExportedPackage
- Specified by:
addExportedPackage
in interfaceCtModule
-
removeExportedPackage
- Specified by:
removeExportedPackage
in interfaceCtModule
-
getOpenedPackages
- Specified by:
getOpenedPackages
in interfaceCtModule
-
setOpenedPackages
- Specified by:
setOpenedPackages
in interfaceCtModule
-
addOpenedPackage
- Specified by:
addOpenedPackage
in interfaceCtModule
-
removeOpenedPackage
- Specified by:
removeOpenedPackage
in interfaceCtModule
-
getRequiredModules
- Specified by:
getRequiredModules
in interfaceCtModule
-
setRequiredModules
- Specified by:
setRequiredModules
in interfaceCtModule
-
addRequiredModule
- Specified by:
addRequiredModule
in interfaceCtModule
-
removeRequiredModule
- Specified by:
removeRequiredModule
in interfaceCtModule
-
getProvidedServices
- Specified by:
getProvidedServices
in interfaceCtModule
-
setProvidedServices
- Specified by:
setProvidedServices
in interfaceCtModule
-
addProvidedService
- Specified by:
addProvidedService
in interfaceCtModule
-
removeProvidedService
- Specified by:
removeProvidedService
in interfaceCtModule
-
getRootPackage
Description copied from interface:CtModule
returns the root package of the unnamed module If there are several modules, it throws an exception- Specified by:
getRootPackage
in interfaceCtModule
-
setRootPackage
- Specified by:
setRootPackage
in interfaceCtModule
-
accept
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
-
getReference
Description copied from interface:CtNamedElement
Returns the corresponding reference.- Specified by:
getReference
in interfaceCtModule
- Specified by:
getReference
in interfaceCtNamedElement
- Overrides:
getReference
in classCtNamedElementImpl
-
clone
Description copied from interface:CtElement
Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methodsRefactoring.copyType(CtType)
andRefactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtModule
- Specified by:
clone
in interfaceCtNamedElement
- Overrides:
clone
in classCtNamedElementImpl
-
setParent
Description copied from interface:CtElement
Manually sets the parent element of the current element.- Specified by:
setParent
in interfaceCtElement
- Overrides:
setParent
in classCtElementImpl
- Type Parameters:
T
- this element's type- Parameters:
parent
- parent reference.- Returns:
- this element
-
getParent
Description copied from interface:CtElement
Gets the parent of current reference.- Specified by:
getParent
in interfaceCtElement
- Overrides:
getParent
in classCtElementImpl
-