Qwylt

java.lang.module.spi
Class ImportConstraint

java.lang.Object
  extended by java.lang.module.spi.ImportConstraint
Direct Known Subclasses:
PackageConstraint, SharesDependentPackages

public abstract class ImportConstraint
extends java.lang.Object

This class represents an abstract constraint over the domain of all candidate imports.

Since:
Jan 20, 2009
Author:
Bryan Atsatt

Nested Class Summary
static class ImportConstraint.Phase
          The phase of the domain.
 
Field Summary
static ImportConstraint HAS_NO_LOOPBACK_CONNECTIONS
          A COMMIT phase ImportConstraint instance that removes connections that refer back to the importer (from an overlapping import/export).
static ImportConstraint HAS_RE_EXPORTS
          A COMMIT phase PackageConstraint instance that adds re-exported packages from all archives imported by module rather than package.
 
Constructor Summary
ImportConstraint()
           
 
Method Summary
abstract  void apply(ImportConstraint.Phase phase, ImportSpace domain)
          Applies this constraint if required for the specified phase, potentially reducing the set of candidates in the domain.
abstract  boolean applyIn(ImportConstraint.Phase phase)
          Returns true if this constraint should be applied in the specified phase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HAS_RE_EXPORTS

public static final ImportConstraint HAS_RE_EXPORTS
A COMMIT phase PackageConstraint instance that adds re-exported packages from all archives imported by module rather than package.


HAS_NO_LOOPBACK_CONNECTIONS

public static final ImportConstraint HAS_NO_LOOPBACK_CONNECTIONS
A COMMIT phase ImportConstraint instance that removes connections that refer back to the importer (from an overlapping import/export).

Constructor Detail

ImportConstraint

public ImportConstraint()
Method Detail

applyIn

public abstract boolean applyIn(ImportConstraint.Phase phase)
Returns true if this constraint should be applied in the specified phase.

Parameters:
phase - The phase.
Returns:
true if constraint should be applied; otherwise, returns false.

apply

public abstract void apply(ImportConstraint.Phase phase,
                           ImportSpace domain)
Applies this constraint if required for the specified phase, potentially reducing the set of candidates in the domain.

Parameters:
phase - The phase of the domain.
domain - The domain.
Throws:
ConnectionError - if the constraint is not satisfied.

Qwylt

Send comments or questions to Bryan Atsatt