org.sonatype.aether.util.artifact
Class OverlayArtifactTypeRegistry

java.lang.Object
  extended by org.sonatype.aether.util.artifact.DefaultArtifactTypeRegistry
      extended by org.sonatype.aether.util.artifact.OverlayArtifactTypeRegistry
All Implemented Interfaces:
ArtifactTypeRegistry

public class OverlayArtifactTypeRegistry
extends DefaultArtifactTypeRegistry

An artifact type registry which first consults its own mappings and in case of an unknown type falls back to another type registry.

Author:
Benjamin Bentmann

Constructor Summary
OverlayArtifactTypeRegistry(ArtifactTypeRegistry delegate)
          Creates a new artifact type registry with initially no registered artifact types and the specified fallback registry.
 
Method Summary
 OverlayArtifactTypeRegistry add(ArtifactType type)
          Adds the specified artifact type to the registry.
 ArtifactType get(String typeId)
          Gets the artifact type with the specified identifier.
 
Methods inherited from class org.sonatype.aether.util.artifact.DefaultArtifactTypeRegistry
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OverlayArtifactTypeRegistry

public OverlayArtifactTypeRegistry(ArtifactTypeRegistry delegate)
Creates a new artifact type registry with initially no registered artifact types and the specified fallback registry. Use add(ArtifactType) to populate the registry.

Parameters:
delegate - The artifact type registry to fall back to, may be null.
Method Detail

add

public OverlayArtifactTypeRegistry add(ArtifactType type)
Description copied from class: DefaultArtifactTypeRegistry
Adds the specified artifact type to the registry.

Overrides:
add in class DefaultArtifactTypeRegistry
Parameters:
type - The artifact type to add, must not be null.
Returns:
This registry for chaining, never null.

get

public ArtifactType get(String typeId)
Description copied from interface: ArtifactTypeRegistry
Gets the artifact type with the specified identifier.

Specified by:
get in interface ArtifactTypeRegistry
Overrides:
get in class DefaultArtifactTypeRegistry
Parameters:
typeId - The identifier of the type, must not be null.
Returns:
The artifact type or null if no type with the requested identifier exists.


Copyright © 2010-2013. All Rights Reserved.