Class DefaultArtifactType

java.lang.Object
org.eclipse.aether.artifact.DefaultArtifactType
All Implemented Interfaces:
ArtifactType

public final class DefaultArtifactType extends Object implements ArtifactType
A simple artifact type.
  • Field Details

    • id

      private final String id
    • extension

      private final String extension
    • classifier

      private final String classifier
    • properties

      private final Map<String,String> properties
  • Constructor Details

    • DefaultArtifactType

      public DefaultArtifactType(String id)
      Creates a new artifact type with the specified identifier. This constructor assumes the usual file extension equals the given type id and that the usual classifier is empty. Additionally, the properties ArtifactProperties.LANGUAGE, ArtifactProperties.CONSTITUTES_BUILD_PATH and ArtifactProperties.INCLUDES_DEPENDENCIES will be set to "none", true and false, respectively.
      Parameters:
      id - The identifier of the type which will also be used as the value for the ArtifactProperties.TYPE property, must not be null or empty.
    • DefaultArtifactType

      public DefaultArtifactType(String id, String extension, String classifier, String language)
      Creates a new artifact type with the specified properties. Additionally, the properties ArtifactProperties.CONSTITUTES_BUILD_PATH and ArtifactProperties.INCLUDES_DEPENDENCIES will be set to true and false, respectively.
      Parameters:
      id - The identifier of the type which will also be used as the value for the ArtifactProperties.TYPE property, must not be null or empty.
      extension - The usual file extension for artifacts of this type, may be null.
      classifier - The usual classifier for artifacts of this type, may be null.
      language - The value for the ArtifactProperties.LANGUAGE property, may be null.
    • DefaultArtifactType

      public DefaultArtifactType(String id, String extension, String classifier, String language, boolean constitutesBuildPath, boolean includesDependencies)
      Creates a new artifact type with the specified properties.
      Parameters:
      id - The identifier of the type which will also be used as the value for the ArtifactProperties.TYPE property, must not be null or empty.
      extension - The usual file extension for artifacts of this type, may be null.
      classifier - The usual classifier for artifacts of this type, may be null.
      language - The value for the ArtifactProperties.LANGUAGE property, may be null.
      constitutesBuildPath - The value for the ArtifactProperties.CONSTITUTES_BUILD_PATH property.
      includesDependencies - The value for the ArtifactProperties.INCLUDES_DEPENDENCIES property.
    • DefaultArtifactType

      public DefaultArtifactType(String id, String extension, String classifier, Map<String,String> properties)
      Creates a new artifact type with the specified properties.
      Parameters:
      id - The identifier of the type, must not be null or empty.
      extension - The usual file extension for artifacts of this type, may be null.
      classifier - The usual classifier for artifacts of this type, may be null.
      properties - The properties for artifacts of this type, may be null.
  • Method Details

    • emptify

      private static String emptify(String str)
    • getId

      public String getId()
      Description copied from interface: ArtifactType
      Gets the identifier of this type, e.g. "maven-plugin" or "test-jar".
      Specified by:
      getId in interface ArtifactType
      Returns:
      The identifier of this type, never null.
      See Also:
    • getExtension

      public String getExtension()
      Description copied from interface: ArtifactType
      Gets the file extension to use for artifacts of this type (unless explicitly overridden by the artifact).
      Specified by:
      getExtension in interface ArtifactType
      Returns:
      The usual file extension, never null.
    • getClassifier

      public String getClassifier()
      Description copied from interface: ArtifactType
      Gets the classifier to use for artifacts of this type (unless explicitly overridden by the artifact).
      Specified by:
      getClassifier in interface ArtifactType
      Returns:
      The usual classifier or an empty string if none, never null.
    • getProperties

      public Map<String,String> getProperties()
      Description copied from interface: ArtifactType
      Gets the properties to use for artifacts of this type (unless explicitly overridden by the artifact).
      Specified by:
      getProperties in interface ArtifactType
      Returns:
      The (read-only) properties, never null.
      See Also: