org.apache.avalon.excalibur.extension
Class OptionalPackage

java.lang.Object
  |
  +--org.apache.avalon.excalibur.extension.OptionalPackage

public final class OptionalPackage
extends java.lang.Object

This contains the required meta-data for an "Optional Package" (formerly known as "Standard Extension") as described in the manifest of a JAR file.

Author:
Peter Donald

Constructor Summary
OptionalPackage(java.io.File file, Extension[] available, Extension[] required)
          Constructor for OptionalPackage.
 
Method Summary
 Extension[] getAvailableExtensions()
          Return Extensions which OptionalPackage makes available.
 java.io.File getFile()
          Return File object in which OptionalPackage is contained.
 Extension[] getRequiredExtensions()
          Return Extensions which OptionalPackage requires to operate.
 boolean isCompatible(Extension extension)
          Return true if any of the available Extensions are compatible with specified extension.
static java.io.File[] toFiles(OptionalPackage[] packages)
          Convert a list of OptionalPackages into a list of Files.
 java.lang.String toString()
          Return a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptionalPackage

public OptionalPackage(java.io.File file,
                       Extension[] available,
                       Extension[] required)
Constructor for OptionalPackage. No parameter is allowed to be null.
Parameters:
file - absolute location of file
available - the list of Extensions Optional Package provides
required - the list of Extensions Optional Package requires
Method Detail

toFiles

public static final java.io.File[] toFiles(OptionalPackage[] packages)
Convert a list of OptionalPackages into a list of Files.
Parameters:
packages - the list of packages
Returns:
the list of files

getFile

public java.io.File getFile()
Return File object in which OptionalPackage is contained.
Returns:
the file object for OptionalPackage

getRequiredExtensions

public Extension[] getRequiredExtensions()
Return Extensions which OptionalPackage requires to operate.
Returns:
the extensions required by OptionalPackage

getAvailableExtensions

public Extension[] getAvailableExtensions()
Return Extensions which OptionalPackage makes available.
Returns:
the extensions made available by OptionalPackage

isCompatible

public boolean isCompatible(Extension extension)
Return true if any of the available Extensions are compatible with specified extension. Otherwise return false.
Parameters:
extension - the extension
Returns:
true if compatible, false otherwise

toString

public java.lang.String toString()
Return a String representation of this object.
Overrides:
toString in class java.lang.Object


Copyright 2001 Apache Jakarta Project. All Rights Reserved.