Qwylt

java.lang.module
Class Import

java.lang.Object
  extended by java.lang.module.AttributeSource
      extended by java.lang.module.ScopedName
          extended by java.lang.module.ExportMatcher
              extended by java.lang.module.Import
All Implemented Interfaces:
Matcher<Export>

public class Import
extends ExportMatcher

An ExportMatcher with an access qualifier that is tied to a specific ModuleArchive.

Since:
Dec 13, 2008
Author:
Bryan Atsatt

Nested Class Summary
static class Import.Access
          Access qualifier.
 
Nested classes/interfaces inherited from class java.lang.module.ScopedName
ScopedName.Scope
 
Field Summary
static Matcher<Version> ANY_VERSION
          A version matcher that will match any version.
 
Fields inherited from class java.lang.module.ExportMatcher
attributeMatcher, versionMatcher
 
Fields inherited from class java.lang.module.AttributeSource
NO_ATTRIBUTES, SERVICE_IMPLEMENTATION_KEY
 
Constructor Summary
Import(Import.Access access, ScopedName.Scope scope, java.lang.String name, Matcher<Version> versionMatcher, AttributeMatcher attributeMatcher, ModuleArchive importer)
          Constructs an instance.
 
Method Summary
 boolean equals(java.lang.Object other)
          Test if the specified object is equal to this instance, enforcing identity comparison.
 Import.Access getAccess()
          Returns the access qualifier.
 ModuleArchive getImporter()
          Returns the ModuleArchive that contains this import.
 int hashCode()
          Returns the identity hash code for this instance.
 boolean isLazy()
          Returns whether or not this import is lazy.
 boolean isOptional()
          Returns true if this Import is optional; otherwise, returns false.
 boolean isReExported()
          Returns true if this Import is re-exported; otherwise, returns false.
 java.lang.String toString()
          Returns a string representation of this instance.
 java.lang.String toString(boolean verbose)
          Returns a string representation of this instance.
protected  void updateString(java.lang.StringBuilder builder, boolean verbose)
          Update the toString() result.
 
Methods inherited from class java.lang.module.ExportMatcher
containsAttribute, getAttribute, getAttributeKeys, getAttributeMatcher, getAttributes, getVersionMatcher, matches
 
Methods inherited from class java.lang.module.ScopedName
getName, getScope, scopedNameEquals, scopedNameEquals, scopedNameHashCode, scopedNameHashCode
 
Methods inherited from class java.lang.module.AttributeSource
appendAttributes, asList, containsAttributes, getAttributeAsList, modifiableList, unmodifiableMap, unmodifiableMap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY_VERSION

public static final Matcher<Version> ANY_VERSION
A version matcher that will match any version.

Constructor Detail

Import

public Import(Import.Access access,
              ScopedName.Scope scope,
              java.lang.String name,
              Matcher<Version> versionMatcher,
              AttributeMatcher attributeMatcher,
              ModuleArchive importer)
Constructs an instance.

Parameters:
access - The access qualifier.
scope - The scope.
name - The name.
versionMatcher - The version matcher. May be null, to match any version.
attributeMatcher - The attribute matcher.
importer - The ModuleArchive that contains this import.
Method Detail

getAccess

public Import.Access getAccess()
Returns the access qualifier.

Returns:
the type.

isOptional

public boolean isOptional()
Returns true if this Import is optional; otherwise, returns false.

Returns:
true if this Import is optional; otherwise, returns false.

isLazy

public boolean isLazy()
Returns whether or not this import is lazy.

Returns:
true if lazy, false if not.

isReExported

public boolean isReExported()
Returns true if this Import is re-exported; otherwise, returns false.

Returns:
true if this Import is re-exported; otherwise, returns false.

getImporter

public ModuleArchive getImporter()
Returns the ModuleArchive that contains this import.

Returns:
The importing ModuleArchive.

equals

public final boolean equals(java.lang.Object other)
Test if the specified object is equal to this instance, enforcing identity comparison.

Overrides:
equals in class java.lang.Object
Parameters:
other - The object to compare to.
Returns:
true if other is the same as this instance; otherwise, returns false.

hashCode

public final int hashCode()
Returns the identity hash code for this instance.

Overrides:
hashCode in class java.lang.Object
Returns:
The identity hash code for this instance.

toString

public java.lang.String toString()
Returns a string representation of this instance.

Overrides:
toString in class ExportMatcher
Returns:
The string.

toString

public java.lang.String toString(boolean verbose)
Returns a string representation of this instance.

Parameters:
verbose - true if result should be verbose.
Returns:
The string.

updateString

protected void updateString(java.lang.StringBuilder builder,
                            boolean verbose)
Update the toString() result.

Parameters:
verbose - true if result should be verbose.
builder - The text to update

Qwylt

Send comments or questions to Bryan Atsatt