Class ModuleInfo

java.lang.Object
org.openide.modules.ModuleInfo

public abstract class ModuleInfo extends Object
General information about a module. Immutable from an API perspective, serves as a source of information only. All instances may be gotten via lookup. It is forbidden for module code to register instances of this class.
Since:
1.24
  • Field Details

    • PROP_ENABLED

      public static final String PROP_ENABLED
      Property name fired when enabled or disabled. For changes in other attributes, property name can match manifest attribute name, for example OpenIDE-Module-Specification-Version after upgrade.
      See Also:
  • Constructor Details

    • ModuleInfo

      protected ModuleInfo()
      Do-nothing constructor.
  • Method Details

    • getCodeNameBase

      public abstract String getCodeNameBase()
      The code name of the module, sans release version.
    • getCodeNameRelease

      public abstract int getCodeNameRelease()
      The release version (-1 if undefined).
    • getCodeName

      public abstract String getCodeName()
      The full code name, with release version after slash if defined.
    • getDisplayName

      public String getDisplayName()
      Get a localized display name, if available. As a fallback provides the code name (base). Convenience method only.
    • getSpecificationVersion

      public abstract SpecificationVersion getSpecificationVersion()
      The specification version, or null.
    • getImplementationVersion

      public String getImplementationVersion()
      The implementation version, or null. Convenience method only.
    • getBuildVersion

      public String getBuildVersion()
      The identification of the build version. Usually build number. If no specific build version is provided then this method delegates to getImplementationVersion().
      Returns:
      textual identification of build version or the value for implementation version
      Since:
      4.18
    • isEnabled

      public abstract boolean isEnabled()
      Whether the module is currently enabled.
    • getAttribute

      public abstract Object getAttribute(String attr)
      Get some attribute, for example OpenIDE-Module-Name. Not all manifest attributes need be supported here. Attributes not present in the manifest may be available.
    • getLocalizedAttribute

      public abstract Object getLocalizedAttribute(String attr)
      Get an attribute with localization. That is, if there is a suitable locale variant of the attribute name, return its value rather than the value of the base attribute.
    • addPropertyChangeListener

      public final void addPropertyChangeListener(PropertyChangeListener l)
      Add a change listener.
    • removePropertyChangeListener

      public final void removePropertyChangeListener(PropertyChangeListener l)
      Remove a change listener.
    • firePropertyChange

      protected final void firePropertyChange(String prop, Object old, Object nue)
      Indicate that something changed, as a subclass. Changes are fired synchronously (but this method need not be called synchronously).
    • getDependencies

      public abstract Set<Dependency> getDependencies()
      Get a list of all dependencies this module has.
    • owns

      public abstract boolean owns(Class<?> clazz)
      Determine if the provided class was loaded as a part of this module, and thus will only be loadable later if this module is enabled. If in doubt, return false.
      Since:
      1.28
      See Also:
    • getClassLoader

      public ClassLoader getClassLoader() throws IllegalArgumentException
      Get a class loader associated with this module that can load classes defined in the module.

      You can only call this method on an enabled module, and the result may change if the module is disabled and reënabled.

      The class loader may or may not be shared with any other module, or be the application's startup class loader, etc.

      For reasons of backward compatibility, this method is not abstract but will throw UnsupportedOperationException if not overridden. The instances obtainable from default lookup will override the method to return a real value.

      Returns:
      a module class loader
      Throws:
      IllegalArgumentException - if this module is disabled
      Since:
      4.21
    • getProvides

      public String[] getProvides()
      Get a set of capabilities which this module provides to others that may require it. The default implementation returns an empty array.
      Returns:
      an array of tokens, possibly empty but not null
      Since:
      2.3