Qwylt

java.lang.module
Class Export

java.lang.Object
  extended by java.lang.module.AttributeSource
      extended by java.lang.module.ScopedName
          extended by java.lang.module.Export

public class Export
extends ScopedName

A versioned ScopedName with dependent packages that is tied to a specific ModuleArchive.

Since:
Mar 14, 2009
Author:
Bryan Atsatt

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.module.ScopedName
ScopedName.Scope
 
Field Summary
static java.util.List<java.lang.String> NO_DEPENDENT_PACKAGES
          An empty dependent packages list.
 
Fields inherited from class java.lang.module.AttributeSource
NO_ATTRIBUTES, SERVICE_IMPLEMENTATION_KEY
 
Constructor Summary
Export(ScopedName.Scope scope, java.lang.String name, Version version, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.List<java.lang.String> dependentPackages, ModuleArchive exporter)
          Constructs an instance for the specified name.
 
Method Summary
 boolean containsAttribute(java.lang.String key)
          Returns true if the specified attribute is present in this instance.
 boolean equals(java.lang.Object other)
          Test if the specified object is equal to this instance, enforcing identity comparison.
 java.lang.String getAttribute(java.lang.String key)
          Returns the attribute value.
 java.util.Set<java.lang.String> getAttributeKeys()
          Returns an unmodifiable set of the attribute keys.
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Returns an unmodifiable map of the attributes.
 java.util.List<java.lang.String> getDependentPackages()
          Returns the package names on which this exported package itself depends.
 ModuleArchive getExporter()
          Returns the ModuleArchive that exports the package named by this PackageExport.
 Version getVersion()
          Returns the version of this PackageExport.
 int hashCode()
          Returns the identity hash code for this instance.
 java.lang.String toString()
          Returns a string representation of this instance.
 java.lang.String toString(boolean verbose)
          Returns a string representation of this instance.
 
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

NO_DEPENDENT_PACKAGES

public static final java.util.List<java.lang.String> NO_DEPENDENT_PACKAGES
An empty dependent packages list.

Constructor Detail

Export

public Export(ScopedName.Scope scope,
              java.lang.String name,
              Version version,
              java.util.Map<java.lang.String,java.lang.String> attributes,
              java.util.List<java.lang.String> dependentPackages,
              ModuleArchive exporter)
Constructs an instance for the specified name.

Parameters:
scope - The scope.
name - The export name.
version - The package version. May be null, in which case the exporter's version will be used.
attributes - The attributes for the specified package. May be null, in which case {link #NO_ATTRIBUTES} will be substituted.
dependentPackages - The dependent package names for the specified package, for which all importers must select the same ClassSpace. May be null, in which case {link #NO_DEPENDENT_PACKAGES} will be substituted.
exporter - The ModuleArchive that contains this export.
Method Detail

getDependentPackages

public java.util.List<java.lang.String> getDependentPackages()
Returns the package names on which this exported package itself depends.

Returns:
The names of the dependent packages.

getExporter

public ModuleArchive getExporter()
Returns the ModuleArchive that exports the package named by this PackageExport.

Returns:
The exporter.

getVersion

public Version getVersion()
Returns the version of this PackageExport.

Returns:
the Version object.

containsAttribute

public boolean containsAttribute(java.lang.String key)
Returns true if the specified attribute is present in this instance.

Specified by:
containsAttribute in class AttributeSource
Parameters:
key - The attribute key.
Returns:
true if the attribute is present.

getAttribute

public java.lang.String getAttribute(java.lang.String key)
Returns the attribute value.

Specified by:
getAttribute in class AttributeSource
Parameters:
key - The attribute key.
Returns:
The attribute value or null if none.

getAttributeKeys

public java.util.Set<java.lang.String> getAttributeKeys()
Returns an unmodifiable set of the attribute keys.

Specified by:
getAttributeKeys in class AttributeSource
Returns:
an unmodifiable set of attribute keys.

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Returns an unmodifiable map of the attributes.

Specified by:
getAttributes in class AttributeSource
Returns:
an unmodifiable map of attributes.

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 ScopedName
Returns:
The string.

toString

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

Returns:
The string.

Qwylt

Send comments or questions to Bryan Atsatt