org.openide.modules
Class ModuleDescription.Dependency

java.lang.Object
  |
  +--org.openide.modules.ModuleDescription.Dependency
Enclosing class:
ModuleDescription

public static final class ModuleDescription.Dependency
extends Object

A type of dependency that the module can have on its environment.

See Also:
ModuleDescription

Field Summary
static int COMPARE_ANY
          No comparison, just require the dependency to be present.
static int COMPARE_IMPL
          Comparison by implementation version.
static int COMPARE_SPEC
          Comparison by specification version.
static int TYPE_IDE
          Dependency on the IDE.
static int TYPE_JAVA
          Dependency on Java.
static int TYPE_MODULE
          Dependency on another module.
static int TYPE_PACKAGE
          Dependency on a package.
 
Method Summary
 String checkForMiss(ModuleDescription[] otherModules)
          Check whether this dependency is currently satisfied by the supplied parameters.
 boolean equals(Object o)
           
 int getComparison()
          Get the comparison type.
 String getName()
          Get the name.
 int getType()
          Get the type.
 String getVersion()
          Get the version.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_MODULE

public static final int TYPE_MODULE
Dependency on another module.

TYPE_PACKAGE

public static final int TYPE_PACKAGE
Dependency on a package.

TYPE_JAVA

public static final int TYPE_JAVA
Dependency on Java.

TYPE_IDE

public static final int TYPE_IDE
Dependency on the IDE.

COMPARE_SPEC

public static final int COMPARE_SPEC
Comparison by specification version. The actual version must equal or exceed the requested version according to Dewey decimal numbering.
See Also:
ModuleDescription.compatibleWith(java.lang.String, java.lang.String)

COMPARE_IMPL

public static final int COMPARE_IMPL
Comparison by implementation version. The actual and requested versions must match exactly as strings.

COMPARE_ANY

public static final int COMPARE_ANY
No comparison, just require the dependency to be present.
Method Detail

getType

public int getType()
Get the type.
Returns:
the type

getName

public String getName()
Get the name.
Returns:
the name

getComparison

public int getComparison()
Get the comparison type.
Returns:
the comparison type

getVersion

public String getVersion()
Get the version.
Returns:
the version (may be null)

checkForMiss

public String checkForMiss(ModuleDescription[] otherModules)
                    throws IllegalModuleException
Check whether this dependency is currently satisfied by the supplied parameters. Note that for dependencies of type TYPE_PACKAGE, the check is against whether that package is loaded into the classloader used by the invoking class.

The following system properties, with sample values, are used to check dependencies of type TYPE_IDE:
NameDescriptionSample
org.openide.specification.versionSpecification version1.0.12
org.openide.versionImplementation versionbuild #999
org.openide.major.version"Code name", i.e. IDE incompatible releaseIDE/2

Parameters:
otherModules - other modules which this dependency might require
Returns:
null if satisfied, else a message explaining why it was not satisfied

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.