Qwylt

java.lang.module
Class ExportMatcher

java.lang.Object
  extended by java.lang.module.AttributeSource
      extended by java.lang.module.ScopedName
          extended by java.lang.module.ExportMatcher
All Implemented Interfaces:
Matcher<Export>
Direct Known Subclasses:
Import, ServiceType

public class ExportMatcher
extends ScopedName
implements Matcher<Export>

A ScopedName used to match against Export instances.

Since:
Dec 21, 2009
Author:
Bryan Atsatt. Copyright (c) 2010 Oracle.

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.module.ScopedName
ScopedName.Scope
 
Field Summary
protected  AttributeMatcher attributeMatcher
           
protected  Matcher<Version> versionMatcher
           
 
Fields inherited from class java.lang.module.AttributeSource
NO_ATTRIBUTES, SERVICE_IMPLEMENTATION_KEY
 
Constructor Summary
ExportMatcher(ScopedName.Scope scope, java.lang.String name)
          Constructor.
ExportMatcher(ScopedName.Scope scope, java.lang.String name, Matcher<Version> versionMatcher)
          Constructor.
ExportMatcher(ScopedName.Scope scope, java.lang.String name, Matcher<Version> versionMatcher, AttributeMatcher attributeMatcher)
          Constructor.
 
Method Summary
 boolean containsAttribute(java.lang.String key)
          Returns true if the specified attribute is present in this instance.
 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.
 AttributeMatcher getAttributeMatcher()
          Returns the attribute matcher.
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Returns an unmodifiable map of the attributes.
 Matcher<Version> getVersionMatcher()
          Returns the version matcher.
 boolean matches(Export export)
          Returns true if the this selector matches the specified export.
 java.lang.String toString()
          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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionMatcher

protected final Matcher<Version> versionMatcher

attributeMatcher

protected final AttributeMatcher attributeMatcher
Constructor Detail

ExportMatcher

public ExportMatcher(ScopedName.Scope scope,
                     java.lang.String name)
Constructor. Matches any version and any attributes.

Parameters:
scope - The scope.
name - The name.

ExportMatcher

public ExportMatcher(ScopedName.Scope scope,
                     java.lang.String name,
                     Matcher<Version> versionMatcher)
Constructor. Matches any attributes.

Parameters:
scope - The scope.
name - The name.
versionMatcher - The version matcher.

ExportMatcher

public ExportMatcher(ScopedName.Scope scope,
                     java.lang.String name,
                     Matcher<Version> versionMatcher,
                     AttributeMatcher attributeMatcher)
Constructor.

Parameters:
scope - The scope.
name - The name.
versionMatcher - The version matcher.
attributeMatcher - The attribute matcher.
Method Detail

getVersionMatcher

public Matcher<Version> getVersionMatcher()
Returns the version matcher.

Returns:
The version matcher.

getAttributeMatcher

public AttributeMatcher getAttributeMatcher()
Returns the attribute matcher.

Returns:
The attribute matcher. May be null.

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.

matches

public boolean matches(Export export)
Returns true if the this selector matches the specified export.

Specified by:
matches in interface Matcher<Export>
Parameters:
export - The export.
Returns:
true if this instance matches the export.

toString

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

Overrides:
toString in class ScopedName
Returns:
The string.

Qwylt

Send comments or questions to Bryan Atsatt