Package gw.internal.gosu.module
Class Module
- java.lang.Object
-
- gw.internal.gosu.module.Module
-
- All Implemented Interfaces:
IModule
- Direct Known Subclasses:
GlobalModule
,JreModule
public class Module extends Object implements IModule
-
-
Field Summary
-
Fields inherited from interface gw.lang.reflect.module.IModule
CONFIG_RESOURCE_PREFIX
-
-
Constructor Summary
Constructors Constructor Description Module(IExecutionEnvironment execEnv, String strName)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.module.IModule
configurePaths
-
-
-
-
Constructor Detail
-
Module
public Module(IExecutionEnvironment execEnv, String strName)
-
-
Method Detail
-
getExecutionEnvironment
public final IExecutionEnvironment getExecutionEnvironment()
- Specified by:
getExecutionEnvironment
in interfaceIModule
-
getFileRepository
public IFileSystemGosuClassRepository getFileRepository()
- Specified by:
getFileRepository
in interfaceIModule
-
setDependencies
public void setDependencies(List<Dependency> newDeps)
- Specified by:
setDependencies
in interfaceIModule
-
getDependencies
public List<Dependency> getDependencies()
- Specified by:
getDependencies
in interfaceIModule
- Returns:
- A list of dependencies for this module. The list may contain both libraries and other modules. The dependency graph must not have cycles.
-
addDependency
public void addDependency(Dependency d)
- Specified by:
addDependency
in interfaceIModule
-
removeDependency
public void removeDependency(Dependency d)
- Specified by:
removeDependency
in interfaceIModule
-
getSourcePath
public List<IDirectory> getSourcePath()
- Specified by:
getSourcePath
in interfaceIModule
- Returns:
- The path[s] having source files that should be exposed to this module.
-
setSourcePath
public void setSourcePath(List<IDirectory> sourcePaths)
- Specified by:
setSourcePath
in interfaceIModule
-
getExcludedPaths
public List<IDirectory> getExcludedPaths()
- Specified by:
getExcludedPaths
in interfaceIModule
-
setExcludedPaths
public void setExcludedPaths(List<IDirectory> paths)
- Specified by:
setExcludedPaths
in interfaceIModule
-
getModuleClassLoader
public ClassLoader getModuleClassLoader()
Description copied from interface:IModule
Get class loader, associated with this module.- Specified by:
getModuleClassLoader
in interfaceIModule
- Returns:
-
disposeLoader
public void disposeLoader()
- Specified by:
disposeLoader
in interfaceIModule
-
getOutputPath
public IDirectory getOutputPath()
- Specified by:
getOutputPath
in interfaceIModule
-
getModuleTypeLoader
public ModuleTypeLoader getModuleTypeLoader()
- Specified by:
getModuleTypeLoader
in interfaceIModule
-
setModuleTypeLoader
public void setModuleTypeLoader(ModuleTypeLoader modTypeLoader)
-
configurePaths
public void configurePaths(List<IDirectory> classpath, List<IDirectory> sourcePaths, List<IDirectory> backingSourcePaths)
Description copied from interface:IModule
Configure both source and Java classpaths of the module in a semi-automated way. First parameter is Java classpath. Second parameter is extended with all paths from Java classpath that are marked to have Gosu "sources" (through MANIFEST.MF with Contains-Sources header) and used as Gosu source path.- Specified by:
configurePaths
in interfaceIModule
- Parameters:
classpath
- path to types not directly in the module's sources e.g., jar files containing .class files and other types/resourcessourcePaths
- path to the sources directly defined in this module; sources in this path are statically compiled as part of this module's build target e.g., ./src directoriesbackingSourcePaths
- path to sources corresponding with the classpath parameter (intended for IDE use)
-
getJavaClassPath
public List<IDirectory> getJavaClassPath()
- Specified by:
getJavaClassPath
in interfaceIModule
-
setJavaClassPath
public void setJavaClassPath(List<IDirectory> classpath)
- Specified by:
setJavaClassPath
in interfaceIModule
-
getBackingSourcePath
public List<IDirectory> getBackingSourcePath()
- Specified by:
getBackingSourcePath
in interfaceIModule
-
setBackingSourcePath
public void setBackingSourcePath(List<IDirectory> backingSourcePath)
- Specified by:
setBackingSourcePath
in interfaceIModule
-
getNativeModule
public Object getNativeModule()
- Specified by:
getNativeModule
in interfaceIModule
- Returns:
- The module/project from the execution environment that corresponds with this logical module. For example, in Eclipse the native module is of type IJavaProject.
-
setNativeModule
public void setNativeModule(INativeModule nativeModule)
- Specified by:
setNativeModule
in interfaceIModule
-
initializeTypeLoaders
public void initializeTypeLoaders()
-
createExtensionTypeLoaders
protected void createExtensionTypeLoaders()
-
createExtensionTypeloadersImpl
protected void createExtensionTypeloadersImpl()
-
createStandardTypeLoaders
protected void createStandardTypeLoaders()
-
maybeCreateModuleTypeLoader
protected void maybeCreateModuleTypeLoader()
-
getModuleTraversalList
public final IModule[] getModuleTraversalList()
- Specified by:
getModuleTraversalList
in interfaceIModule
-
getTypeLoaders
public <T extends ITypeLoader> List<? extends T> getTypeLoaders(Class<T> typeLoaderClass)
Description copied from interface:IModule
Returns typeloaders of the given class that are local to this module as well as such typeloaders from dependent modules.- Specified by:
getTypeLoaders
in interfaceIModule
- Returns:
-
getName
public String getName()
-
getAdditionalSourceRoots
protected List<IDirectory> getAdditionalSourceRoots()
-
-