ConForM.CoopnTools.CoKer.PackageMgr
Class PackageMgr

java.lang.Object
  |
  +--ConForM.CoopnTools.CoKer.PackageMgr.PackageMgr

public class PackageMgr
extends java.lang.Object

Package Manager. This class essentially defines the services provided by the package manager.


Field Summary
static int ASPECT
          Coopn Aspect tag.
static int COALASOURCE
          Coala sources tag.
static int CONSTRAINT
          Constraint tag.
static int COOPNDIGEST
          Coopn compact tag.
static int COOPNSOURCE
          Coopn sources tag.
static java.lang.String[] fileExtensions
          File extensions.
static boolean[] lexicalReaders
          Possibilities of lexical reading.
static int LOGIC
          Logic file tag.
static int MODULEKINDNUMBER
          Number of kind of modules.
static int PACKAGE
          Package file tag.
static int SCENARIO
          Scenario tag.
static int SPECIFICATION
          Specification file tag.
static boolean[] syntacticReaders
          Possibilities of syntactic reading.
static int TEST
          Specification file tag.
static java.lang.String VERSION
          Package Manager version;
 
Constructor Summary
PackageMgr(CoopnEnv env)
          Constructor.
PackageMgr(java.lang.String pack, CoopnEnv env)
          Constructor.
 
Method Summary
 java.lang.String[] accessibleEntries(java.lang.String packageName, int moduleKind)
          Get the entries accessible from a package.
 void addAssociatedEntry(java.lang.String packageName, int entryKind, java.lang.String entryName)
          Associate a module entry to the package.
 void addAssociatedEntry(java.lang.String packageName, int entryKind, java.lang.String entryName, java.lang.String fileName)
          Associate a module entry to the package.
 void addAuthor(java.lang.String packageName, PackageAuthorSymbol symbol)
          Add an author.
 void addEntry(java.lang.String packageName, PackageEntrySymbol symbol)
          Add a module entry.
 void addUse(java.lang.String packageName, PackageUseSymbol symbol)
          Add an use.
 void createPackage(java.lang.String packageName, java.lang.String comment, java.lang.String version, java.lang.String date)
          Creates a package.
 java.lang.String[] definedEntries(java.lang.String packageName, int moduleKind)
          Get the entries defined in (i.e. directly accessible from) a package.
 java.lang.String displayComment(java.lang.String elem)
          Comment to String conversion.
 java.lang.String displayModuleName(java.lang.String elem)
          ModuleName to String conversion.
 java.lang.String displayName(java.lang.String elem)
          Name to String conversion.
 void dispose()
          Leave a package manager.
 java.lang.String evalComment(java.lang.String string)
          String to comment conversion.
 java.lang.String evalModuleName(java.lang.String string)
          String to ModuleName conversion.
 java.lang.String evalName(java.lang.String string)
          String to Name conversion.
 java.io.File getAndObserveFile(java.lang.String moduleName, int moduleKind, FileObserver observer)
          Get a file and register a file observer.
 java.io.File getAndObserveFile(java.lang.String moduleName, int moduleKind, java.lang.String altName, FileObserver observer)
          Get a file and register a file observer.
 java.io.File getAndObserveFile(java.lang.String moduleName, int moduleKind, java.lang.String altName, int altKind, FileObserver observer)
          Get a file and register a file observer.
 PackageModule getAndObservePackageModule(java.lang.String packageName, PackageModuleObserver observer)
          Get a package module and register a package module observer.
 CoopnEnv getEnv(int moduleType)
          Get the environment.
 java.io.File getFile(java.lang.String moduleName, int moduleKind)
          Get a file.
 java.io.File getFile(java.lang.String moduleName, int moduleKind, java.lang.String altName)
          Get a file.
 java.io.File getFile(java.lang.String moduleName, int moduleKind, java.lang.String altName, int altKind)
          Get a file.
 LexicalReader getLexicalReader(int moduleKind, java.io.Reader reader)
          Get a lexical reader for a particular kind of module.
 PackageModule getPackageModule(java.lang.String packageName)
          Get a package module.
 PackageModule getPackageOf(java.lang.String moduleName, int moduleKind)
          Retrieve the package defining a particular module.
 PackageModule getPackageOf(java.lang.String moduleName, int moduleKind, java.lang.String altName)
          Retrieve the package defining a particular module.
 PackageModule getPackageOf(java.lang.String moduleName, int moduleKind, java.lang.String altName, int altKind)
          Retrieve the package defining a particular module.
 SyntacticModuleReader getSyntacticModuleReader(int moduleKind)
          Get a syntactic module reader for a particular kind of module.
 boolean isLibrary(java.lang.String moduleName, int moduleKind)
          Is library decision.
 boolean isLibrary(java.lang.String moduleName, int moduleKind, java.lang.String altName)
          Is library decision.
 boolean isLibrary(java.lang.String moduleName, int moduleKind, java.lang.String altName, int altKind)
          Is library decision.
 CoopnUser lockPackageModule(java.lang.String packageName, CoopnUser user)
          Lock a package module.
 void modifyComment(java.lang.String packageName, java.lang.String comment)
          Change the comment of a package.
 void modifyDate(java.lang.String packageName, java.lang.String date)
          Change the date of a package.
 void modifyVersion(java.lang.String packageName, java.lang.String version)
          Change the version of a package.
 void reloadPackageModule(java.lang.String packageName)
          Reload a package module from the disk.
 void removeAssociatedEntry(java.lang.String packageName, int entryKind, java.lang.String entryName, java.lang.String fileName)
          Remove an associated module entry to the package.
 void removeAuthor(java.lang.String packageName, PackageAuthorSymbol symbol)
          Remove an author.
 void removeEntry(java.lang.String packageName, PackageEntrySymbol symbol)
          Remove a module entry.
 void removeUse(java.lang.String packageName, PackageUseSymbol symbol)
          Remove an use.
 java.lang.String rootPackage()
          Get the root package as a String.
 void syncPackageModule(java.lang.String packageName)
          Sync a package module.
 void unlockPackageModule(java.lang.String packageName)
          Unlock a package module.
 void unregisterFileObserver(java.lang.String moduleName, int moduleKind, FileObserver observer)
          unregister a file observer.
 void unregisterObserver(java.lang.String packageName, PackageModuleObserver observer)
          unregister a package module observer.
 boolean upToDate(CoopnCompilInfo info, int moduleKind)
          Up-to-Date decision.
 boolean upToDate(CoopnTimestamp time, java.lang.String moduleName, int moduleKind)
          Up-to-Date decision.
 boolean upToDate(java.io.File file, java.lang.String moduleName, int moduleKind)
          Up-to-Date decision.
 void use()
          Uses a package manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Package Manager version;

MODULEKINDNUMBER

public static final int MODULEKINDNUMBER
Number of kind of modules.

ASPECT

public static final int ASPECT
Coopn Aspect tag.

COALASOURCE

public static final int COALASOURCE
Coala sources tag.

COOPNDIGEST

public static final int COOPNDIGEST
Coopn compact tag.

CONSTRAINT

public static final int CONSTRAINT
Constraint tag.

COOPNSOURCE

public static final int COOPNSOURCE
Coopn sources tag.

PACKAGE

public static final int PACKAGE
Package file tag.

LOGIC

public static final int LOGIC
Logic file tag.

SCENARIO

public static final int SCENARIO
Scenario tag.

SPECIFICATION

public static final int SPECIFICATION
Specification file tag.

TEST

public static final int TEST
Specification file tag.

fileExtensions

public static final java.lang.String[] fileExtensions
File extensions. This array associates a module kind and its extension.
See Also:
COOPNSOURCE

lexicalReaders

public static final boolean[] lexicalReaders
Possibilities of lexical reading. Update the method getLexicalReader below.

syntacticReaders

public static final boolean[] syntacticReaders
Possibilities of syntactic reading. Update the method getSyntacticModuleReader below.
Constructor Detail

PackageMgr

public PackageMgr(java.lang.String pack,
                  CoopnEnv env)
           throws java.lang.IllegalArgumentException,
                  java.io.IOException
Constructor. Build and use a new package manager, for a particular package.
Parameters:
pack - the package
env - the environment of the package manager
Throws:
java.lang.IllegalArgumentException - the environment is absent or inconsistent.
java.io.IOException - error was detected when loading the package files used by the project.

PackageMgr

public PackageMgr(CoopnEnv env)
           throws java.lang.IllegalArgumentException,
                  java.io.IOException
Constructor. Build and use a new package manageraccording to the environment.
Parameters:
pack - the package
env - the environment of the package manager
Throws:
java.lang.IllegalArgumentException - the environment is absent or inconsistent.
java.io.IOException - error was detected when loading the package files used by the project.
Method Detail

use

public void use()
Uses a package manager.

dispose

public void dispose()
Leave a package manager. This method release the resources used by this manager, if it is not used any more.

getEnv

public CoopnEnv getEnv(int moduleType)
                throws java.lang.IllegalArgumentException
Get the environment. The package manager modify the environment associated to a tool, according to the package flag. This method allows the tool to retrieve this information.
Parameters:
moduleType - the module Type.
Returns:
the new environment.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

rootPackage

public java.lang.String rootPackage()
Get the root package as a String.

upToDate

public boolean upToDate(CoopnCompilInfo info,
                        int moduleKind)
                 throws java.lang.IllegalArgumentException
Up-to-Date decision. Decide if a compiled module is up-to-date with regard to the storage files of the compilation dependencies.
Parameters:
info - the compilation information associated to the module
moduleKind - the module type
Returns:
true if the compiled module is up-to-date.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

upToDate

public boolean upToDate(CoopnTimestamp time,
                        java.lang.String moduleName,
                        int moduleKind)
                 throws java.lang.IllegalArgumentException
Up-to-Date decision. Decide if a timestamp is up-to-date with regard to the storage file containing the module argument. It this storage file does not exist, returns true.
Parameters:
time - the time stamp
moduleName - the module name
moduleKind - the module kind
Returns:
true if the timestamp is up-to-date.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

upToDate

public boolean upToDate(java.io.File file,
                        java.lang.String moduleName,
                        int moduleKind)
                 throws java.lang.IllegalArgumentException
Up-to-Date decision. Decide if a File is up-to-date with regard to the storage file containing the module argument. It this storage file does not exist, returns true.
Parameters:
file - the file
moduleName - the module name
moduleKind - the module kind
Returns:
true if the timestamp is up-to-date.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

isLibrary

public boolean isLibrary(java.lang.String moduleName,
                         int moduleKind)
                  throws java.lang.IllegalArgumentException
Is library decision. Decide if a module is to be considered as a library module. Library modules should not be modified.
Parameters:
moduleName - the module name
moduleKind - the module type; must be in the range 0..MODULEKINDNUMBER-1, and different from PACKAGE
Returns:
true if the module is considered as a library module.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

isLibrary

public boolean isLibrary(java.lang.String moduleName,
                         int moduleKind,
                         java.lang.String altName)
                  throws java.lang.IllegalArgumentException
Is library decision. Decide if a module is to be considered as a library module. An alternate module name may be used to retrieve the project information. Library modules should not be modified.
Parameters:
moduleName - the module name
moduleKind - the module type; must be in the range 0..MODULEKINDNUMBER-1, and different from PACKAGE
altName - the alternate module name
Returns:
true if the module is considered as a library module.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

isLibrary

public boolean isLibrary(java.lang.String moduleName,
                         int moduleKind,
                         java.lang.String altName,
                         int altKind)
                  throws java.lang.IllegalArgumentException
Is library decision. Decide if a module is to be considered as a library module. An alternate module name and type may be used to retrieve the project information. Library modules should not be modified.
Parameters:
moduleName - the module name
moduleKind - the module type; must be in the range 0..MODULEKINDNUMBER-1, and different from PACKAGE
altName - the alternate module name
altKind - the alternate module type. Must be in the range 0..MODULEKINDNUMBER-1.
Returns:
true if the module is considered as a library module.
Throws:
java.lang.IllegalArgumentException - the module kind is illegal, or a problem occured with the environment.

getPackageOf

public PackageModule getPackageOf(java.lang.String moduleName,
                                  int moduleKind)
                           throws java.lang.IllegalArgumentException
Retrieve the package defining a particular module. If the particular is a package, it returns itself. Else, if returns the package module defining the module, i.e. the package module havinf an adequate entry.
Parameters:
moduleName - the module name
moduleKind - the module type; must be in the range 0..MODULEKINDNUMBER-1, and different from PACKAGE
Returns:
the package defining the module, or null iff not found.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

getPackageOf

public PackageModule getPackageOf(java.lang.String moduleName,
                                  int moduleKind,
                                  java.lang.String altName)
                           throws java.lang.IllegalArgumentException
Retrieve the package defining a particular module. If the particular is a package, it returns itself. Else, if returns the package module defining the module, i.e. the package module havinf an adequate entry. An alternate module name may be used to retrieve the project information.
Parameters:
moduleName - the module name
moduleKind - the module type; must be in the range 0..MODULEKINDNUMBER-1, and different from PACKAGE
altName - the alternate module name
Returns:
the package defining the module, or null iff not found.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

getPackageOf

public PackageModule getPackageOf(java.lang.String moduleName,
                                  int moduleKind,
                                  java.lang.String altName,
                                  int altKind)
                           throws java.lang.IllegalArgumentException
Retrieve the package defining a particular module. If the particular is a package, it returns itself. Else, if returns the package module defining the module, i.e. the package module havinf an adequate entry. An alternate module name and type may be used to retrieve the project information.
Parameters:
moduleName - the module name
moduleKind - the module type; must be in the range 0..MODULEKINDNUMBER-1, and different from PACKAGE
altName - the alternate module name
altKind - the alternate module type. Must be in the range 0..MODULEKINDNUMBER-1.
Returns:
the package defining the module, or null iff not found.
Throws:
java.lang.IllegalArgumentException - the module kind is illegal, or a problem occured with the environment.

getFile

public java.io.File getFile(java.lang.String moduleName,
                            int moduleKind)
                     throws java.lang.IllegalArgumentException
Get a file. Builds and returns a file (name) from a logical module name and module kind.
Parameters:
moduleName - the module name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
Returns:
the File corresponding to the module. This file is not guaranted to exist in the storage media, but its directory is.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

getFile

public java.io.File getFile(java.lang.String moduleName,
                            int moduleKind,
                            java.lang.String altName)
                     throws java.lang.IllegalArgumentException
Get a file. Builds and returns a file (name) from a logical module name and module kind. An alternate module name may be used to retrieve the project information.
Parameters:
moduleName - the module name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
altName - the alternate module name
Returns:
the File corresponding to the module. This file is not guaranted to exist in the storage media, but its directory is.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

getFile

public java.io.File getFile(java.lang.String moduleName,
                            int moduleKind,
                            java.lang.String altName,
                            int altKind)
                     throws java.lang.IllegalArgumentException
Get a file. Builds and returns a file (name) from a logical module name and module kind. An alternate module name and type may be used to retrieve the project information.
Parameters:
moduleName - the module name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
altName - the alternate module name
altKind - the alternate module type. Must be in the range 0..MODULEKINDNUMBER-1.
Returns:
the File corresponding to the module. This file is not guaranted to exist in the storage media, but its directory is.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

getAndObserveFile

public java.io.File getAndObserveFile(java.lang.String moduleName,
                                      int moduleKind,
                                      FileObserver observer)
                               throws java.lang.IllegalArgumentException
Get a file and register a file observer. Builds and returns a file (name) from a logical module name and module kind.
Parameters:
moduleName - the module name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
observer - the file observer
Returns:
the File corresponding to the module. This file is not guaranted to exist in the storage media, but its directory is.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

getAndObserveFile

public java.io.File getAndObserveFile(java.lang.String moduleName,
                                      int moduleKind,
                                      java.lang.String altName,
                                      FileObserver observer)
                               throws java.lang.IllegalArgumentException
Get a file and register a file observer. Builds and returns a file (name) from a logical module name and module kind. An alternate module name may be used to retrieve the project information.
Parameters:
moduleName - the module name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
altName - the alternate module name
observer - the file observer
Returns:
the File corresponding to the module. This file is not guaranted to exist in the storage media, but its directory is.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

getAndObserveFile

public java.io.File getAndObserveFile(java.lang.String moduleName,
                                      int moduleKind,
                                      java.lang.String altName,
                                      int altKind,
                                      FileObserver observer)
                               throws java.lang.IllegalArgumentException
Get a file and register a file observer. Builds and returns a file (name) from a logical module name and module kind. An alternate module name and type may be used to retrieve the project information.
Parameters:
moduleName - the module name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
altName - the alternate module name
altKind - the alternate module type. Must be in the range 0..MODULEKINDNUMBER-1.
observer - the file observer
Returns:
the File corresponding to the module. This file is not guaranted to exist in the storage media, but its directory is.
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

unregisterFileObserver

public void unregisterFileObserver(java.lang.String moduleName,
                                   int moduleKind,
                                   FileObserver observer)
unregister a file observer.
Parameters:
moduleName - the module name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
observer - the file observer
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

accessibleEntries

public java.lang.String[] accessibleEntries(java.lang.String packageName,
                                            int moduleKind)
Get the entries accessible from a package.
Parameters:
packageName - the root package name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
observer - the file observer
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

definedEntries

public java.lang.String[] definedEntries(java.lang.String packageName,
                                         int moduleKind)
Get the entries defined in (i.e. directly accessible from) a package.
Parameters:
packageName - the root package name
moduleKind - the module type. Must be in the range 0..MODULEKINDNUMBER-1.
observer - the file observer
Throws:
java.lang.IllegalArgumentException - the module type is illegal, or a problem occured with the environment.

getPackageModule

public PackageModule getPackageModule(java.lang.String packageName)
                               throws java.lang.IllegalArgumentException
Get a package module. Return the desired package module.
Parameters:
packageName - the package name
Returns:
an unmodifiable instance of the package module, or null iff not found.
Throws:
java.lang.IllegalArgumentException - A problem occured with the environment.

getAndObservePackageModule

public PackageModule getAndObservePackageModule(java.lang.String packageName,
                                                PackageModuleObserver observer)
                                         throws java.lang.IllegalArgumentException
Get a package module and register a package module observer. Return the desired package module.
Parameters:
packageName - the package name
observer - the package module observer
Returns:
an unmodifiable instance of the package module, or null iff not found.
Throws:
java.lang.IllegalArgumentException - A problem occured with the environment.

unregisterObserver

public void unregisterObserver(java.lang.String packageName,
                               PackageModuleObserver observer)
unregister a package module observer.
Parameters:
packageName - the package name
observer - the package module observer
Throws:
java.lang.IllegalArgumentException - A problem occured with the environment.

addAssociatedEntry

public void addAssociatedEntry(java.lang.String packageName,
                               int entryKind,
                               java.lang.String entryName)
Associate a module entry to the package. A new module is associated to the package, in a file with the same name than the module. If the module is already associated to the spec, does nothing. The package does not have to be locked. This method DOES NOT chnage the last modified time of the package file.
Parameters:
packageName - the package name; if null then method has no effect
entryKind - the entry kind
entryName - the entry name
Throws:
java.lang.IllegalArgumentException - the package is not found.

addAssociatedEntry

public void addAssociatedEntry(java.lang.String packageName,
                               int entryKind,
                               java.lang.String entryName,
                               java.lang.String fileName)
Associate a module entry to the package. A new module is associated to the package. If the module is already associated to the spec, does nothing. The package does not have to be locked. This method DOES NOT chnage the last modified time of the package file.
Parameters:
packageName - the package name; if null then method has no effect
entryKind - the entry kind
entryName - the entry name
fileName - the file name
Throws:
java.lang.IllegalArgumentException - the package is not found.

removeAssociatedEntry

public void removeAssociatedEntry(java.lang.String packageName,
                                  int entryKind,
                                  java.lang.String entryName,
                                  java.lang.String fileName)
Remove an associated module entry to the package. The entry is removed from the package. The package does not have to be locked. This method DOES NOT chnage the last modified time of the package file.
Parameters:
packageName - the package name; if null then method has no effect
entryKind - the entry kind
entryName - the entry name
fileName - the file name
Throws:
java.lang.IllegalArgumentException - the package is not found.

reloadPackageModule

public void reloadPackageModule(java.lang.String packageName)
                         throws java.lang.IllegalAccessException
Reload a package module from the disk.
Parameters:
packageName - the package name
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

createPackage

public void createPackage(java.lang.String packageName,
                          java.lang.String comment,
                          java.lang.String version,
                          java.lang.String date)
                   throws java.lang.IllegalAccessException
Creates a package.
Parameters:
packageName - the package name
comment - the associated comment; may be null
version - the package version; may be null
date - the package date; may be null
Throws:
java.lang.IllegalArgumentException - problem with arguments.
java.lang.IllegalAccessException - the package is not locked.

modifyComment

public void modifyComment(java.lang.String packageName,
                          java.lang.String comment)
                   throws java.lang.IllegalAccessException
Change the comment of a package.
Parameters:
packageName - the package name
comment - the new comment, or null of no comment
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

modifyVersion

public void modifyVersion(java.lang.String packageName,
                          java.lang.String version)
                   throws java.lang.IllegalAccessException
Change the version of a package.
Parameters:
packageName - the package name
version - the new version, or null of no version
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

modifyDate

public void modifyDate(java.lang.String packageName,
                       java.lang.String date)
                throws java.lang.IllegalAccessException
Change the date of a package.
Parameters:
packageName - the package name
date - the new date, or null of no date
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

addAuthor

public void addAuthor(java.lang.String packageName,
                      PackageAuthorSymbol symbol)
               throws java.lang.IllegalAccessException
Add an author.
Parameters:
packageName - the package name
symbol - the author symbol
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

removeAuthor

public void removeAuthor(java.lang.String packageName,
                         PackageAuthorSymbol symbol)
                  throws java.lang.IllegalAccessException
Remove an author.
Parameters:
packageName - the package name
symbol - the author symbol
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

addUse

public void addUse(java.lang.String packageName,
                   PackageUseSymbol symbol)
            throws java.lang.IllegalAccessException
Add an use.
Parameters:
packageName - the package name
symbol - the use symbol
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

removeUse

public void removeUse(java.lang.String packageName,
                      PackageUseSymbol symbol)
               throws java.lang.IllegalAccessException
Remove an use.
Parameters:
packageName - the package name
symbol - the use symbol
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

addEntry

public void addEntry(java.lang.String packageName,
                     PackageEntrySymbol symbol)
              throws java.lang.IllegalAccessException
Add a module entry.
Parameters:
packageName - the package name
symbol - the module entry symbol
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

removeEntry

public void removeEntry(java.lang.String packageName,
                        PackageEntrySymbol symbol)
                 throws java.lang.IllegalAccessException
Remove a module entry.
Parameters:
packageName - the package name
symbol - the module entry symbol
Throws:
java.lang.IllegalArgumentException - the package is not found.
java.lang.IllegalAccessException - the package is not locked.

lockPackageModule

public CoopnUser lockPackageModule(java.lang.String packageName,
                                   CoopnUser user)
Lock a package module. Only one lock may exist on a package module at the same time. Only locked modules may be modified.
Parameters:
packagename - the package to lock
user - the user who want to acquire the lock
Returns:
null iff this operation succeeded, i.e. if the lock is granted; the user which already has the lock else.
Throws:
java.lang.IllegalArgumentException - an argument is illegal

unlockPackageModule

public void unlockPackageModule(java.lang.String packageName)
Unlock a package module. If the package module was locked, it is stored on disk (if needed). Else, nothing happens...

syncPackageModule

public void syncPackageModule(java.lang.String packageName)
Sync a package module. If the package module was locked, it is stored on disk (if needed). Else, nothing happens...

evalComment

public java.lang.String evalComment(java.lang.String string)
                             throws java.lang.IllegalArgumentException
String to comment conversion. Evaluates a string into a valid Coopn comment.
Parameters:
string - the string to evaluates; may be null
Returns:
the desired package comment.
Throws:
java.lang.IllegalArgumentException - the element cannot be delivered (because it is erroneous, and so on).

displayComment

public java.lang.String displayComment(java.lang.String elem)
                                throws java.lang.IllegalArgumentException
Comment to String conversion. Display a comment into a string representing it.
Parameters:
elem - the element to display; may be null
Returns:
the desired string.
Throws:
java.lang.IllegalArgumentException - the string cannot be delivered (because it is erroneous, and so on).

evalName

public java.lang.String evalName(java.lang.String string)
                          throws java.lang.IllegalArgumentException
String to Name conversion. Evaluates a string into a valid package name.
Parameters:
string - the string to evaluates
Returns:
the desired package name as a String.
Throws:
java.lang.IllegalArgumentException - the element cannot be delivered (because it is erroneous, and so on).

displayName

public java.lang.String displayName(java.lang.String elem)
                             throws java.lang.IllegalArgumentException
Name to String conversion. Display a Name into a string representing it.
Parameters:
elem - the element to display
Returns:
the desired string.
Throws:
java.lang.IllegalArgumentException - the string cannot be delivered (because it is erroneous, and so on).

evalModuleName

public java.lang.String evalModuleName(java.lang.String string)
                                throws java.lang.IllegalArgumentException
String to ModuleName conversion. Evaluates a string into a valid package module name.
Parameters:
string - the string to evaluates
Returns:
the desired package module name as a String.
Throws:
java.lang.IllegalArgumentException - the element cannot be delivered (because it is erroneous, and so on).

displayModuleName

public java.lang.String displayModuleName(java.lang.String elem)
                                   throws java.lang.IllegalArgumentException
ModuleName to String conversion. Display a module name into a string representing it.
Parameters:
elem - the element to display
Returns:
the desired string.
Throws:
java.lang.IllegalArgumentException - the string cannot be delivered (because it is erroneous, and so on).

getLexicalReader

public LexicalReader getLexicalReader(int moduleKind,
                                      java.io.Reader reader)
Get a lexical reader for a particular kind of module.
Parameters:
moduleKind - the kind of module
reader - input input file reader
Returns:
a new instance of a lexical reader, or null if no lexical readers are associated to this kind of module.
Throws:
java.lang.IllegalArgumentException - a problem occured with the environment.

getSyntacticModuleReader

public SyntacticModuleReader getSyntacticModuleReader(int moduleKind)
Get a syntactic module reader for a particular kind of module.
Parameters:
moduleKind - the kind of module
Returns:
a new instance of a syntactic module reader, or null if no syntacic readers are associated to this kind of module.
Throws:
java.lang.IllegalArgumentException - a problem occured with the environment.