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
  • Constructor Details

  • Method Details

    • getExecutionEnvironment

      public final IExecutionEnvironment getExecutionEnvironment()
      Specified by:
      getExecutionEnvironment in interface IModule
    • getFileRepository

      public IFileSystemGosuClassRepository getFileRepository()
      Specified by:
      getFileRepository in interface IModule
    • setDependencies

      public void setDependencies(List<Dependency> newDeps)
      Specified by:
      setDependencies in interface IModule
    • getDependencies

      public List<Dependency> getDependencies()
      Specified by:
      getDependencies in interface IModule
      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 interface IModule
    • removeDependency

      public void removeDependency(Dependency d)
      Specified by:
      removeDependency in interface IModule
    • getSourcePath

      public List<IDirectory> getSourcePath()
      Specified by:
      getSourcePath in interface IModule
      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 interface IModule
    • getExcludedPaths

      public List<IDirectory> getExcludedPaths()
      Specified by:
      getExcludedPaths in interface IModule
    • setExcludedPaths

      public void setExcludedPaths(List<IDirectory> paths)
      Specified by:
      setExcludedPaths in interface IModule
    • getModuleClassLoader

      public ClassLoader getModuleClassLoader()
      Description copied from interface: IModule
      Get class loader, associated with this module.
      Specified by:
      getModuleClassLoader in interface IModule
      Returns:
    • disposeLoader

      public void disposeLoader()
      Specified by:
      disposeLoader in interface IModule
    • getOutputPath

      public IDirectory getOutputPath()
      Specified by:
      getOutputPath in interface IModule
    • getModuleTypeLoader

      public ModuleTypeLoader getModuleTypeLoader()
      Specified by:
      getModuleTypeLoader in interface IModule
    • 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 interface IModule
      Parameters:
      classpath - path to types not directly in the module's sources e.g., jar files containing .class files and other types/resources
      sourcePaths - 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 directories
      backingSourcePaths - path to sources corresponding with the classpath parameter (intended for IDE use)
    • getJavaClassPath

      public List<IDirectory> getJavaClassPath()
      Specified by:
      getJavaClassPath in interface IModule
    • setJavaClassPath

      public void setJavaClassPath(List<IDirectory> classpath)
      Specified by:
      setJavaClassPath in interface IModule
    • getBackingSourcePath

      public List<IDirectory> getBackingSourcePath()
      Specified by:
      getBackingSourcePath in interface IModule
    • setBackingSourcePath

      public void setBackingSourcePath(List<IDirectory> backingSourcePath)
      Specified by:
      setBackingSourcePath in interface IModule
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNativeModule

      public Object getNativeModule()
      Specified by:
      getNativeModule in interface IModule
      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 interface IModule
    • 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 interface IModule
    • traverse

      protected void traverse(IModule theModule, List<IModule> traversalList)
    • 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 interface IModule
      Type Parameters:
      T -
      Parameters:
      typeLoaderClass -
      Returns:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getName

      public String getName()
      Specified by:
      getName in interface IModule
      Returns:
      A unique name relative to all other modules in a given execution environment.
    • setName

      public void setName(String name)
      Specified by:
      setName in interface IModule
    • getAdditionalSourceRoots

      protected List<IDirectory> getAdditionalSourceRoots()