Package org.eclipse.aether.artifact
Class DefaultArtifactType
- java.lang.Object
-
- org.eclipse.aether.artifact.DefaultArtifactType
-
- All Implemented Interfaces:
ArtifactType
public final class DefaultArtifactType extends java.lang.Object implements ArtifactType
A simple artifact type.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringclassifierprivate java.lang.Stringextensionprivate java.lang.Stringidprivate java.util.Map<java.lang.String,java.lang.String>properties
-
Constructor Summary
Constructors Constructor Description DefaultArtifactType(java.lang.String id)Creates a new artifact type with the specified identifier.DefaultArtifactType(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.lang.String language)Creates a new artifact type with the specified properties.DefaultArtifactType(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.lang.String language, boolean constitutesBuildPath, boolean includesDependencies)Creates a new artifact type with the specified properties.DefaultArtifactType(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.util.Map<java.lang.String,java.lang.String> properties)Creates a new artifact type with the specified properties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.Stringemptify(java.lang.String str)java.lang.StringgetClassifier()Gets the classifier to use for artifacts of this type (unless explicitly overridden by the artifact).java.lang.StringgetExtension()Gets the file extension to use for artifacts of this type (unless explicitly overridden by the artifact).java.lang.StringgetId()Gets the identifier of this type, e.g.java.util.Map<java.lang.String,java.lang.String>getProperties()Gets the properties to use for artifacts of this type (unless explicitly overridden by the artifact).
-
-
-
Constructor Detail
-
DefaultArtifactType
public DefaultArtifactType(java.lang.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 propertiesArtifactProperties.LANGUAGE,ArtifactProperties.CONSTITUTES_BUILD_PATHandArtifactProperties.INCLUDES_DEPENDENCIESwill be set to"none",trueandfalse, respectively.- Parameters:
id- The identifier of the type which will also be used as the value for theArtifactProperties.TYPEproperty, must not benullor empty.
-
DefaultArtifactType
public DefaultArtifactType(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.lang.String language)Creates a new artifact type with the specified properties. Additionally, the propertiesArtifactProperties.CONSTITUTES_BUILD_PATHandArtifactProperties.INCLUDES_DEPENDENCIESwill be set totrueandfalse, respectively.- Parameters:
id- The identifier of the type which will also be used as the value for theArtifactProperties.TYPEproperty, must not benullor empty.extension- The usual file extension for artifacts of this type, may benull.classifier- The usual classifier for artifacts of this type, may benull.language- The value for theArtifactProperties.LANGUAGEproperty, may benull.
-
DefaultArtifactType
public DefaultArtifactType(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.lang.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 theArtifactProperties.TYPEproperty, must not benullor empty.extension- The usual file extension for artifacts of this type, may benull.classifier- The usual classifier for artifacts of this type, may benull.language- The value for theArtifactProperties.LANGUAGEproperty, may benull.constitutesBuildPath- The value for theArtifactProperties.CONSTITUTES_BUILD_PATHproperty.includesDependencies- The value for theArtifactProperties.INCLUDES_DEPENDENCIESproperty.
-
DefaultArtifactType
public DefaultArtifactType(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.util.Map<java.lang.String,java.lang.String> properties)Creates a new artifact type with the specified properties.- Parameters:
id- The identifier of the type, must not benullor empty.extension- The usual file extension for artifacts of this type, may benull.classifier- The usual classifier for artifacts of this type, may benull.properties- The properties for artifacts of this type, may benull.
-
-
Method Detail
-
emptify
private static java.lang.String emptify(java.lang.String str)
-
getId
public java.lang.String getId()
Description copied from interface:ArtifactTypeGets the identifier of this type, e.g. "maven-plugin" or "test-jar".- Specified by:
getIdin interfaceArtifactType- Returns:
- The identifier of this type, never
null. - See Also:
ArtifactProperties.TYPE
-
getExtension
public java.lang.String getExtension()
Description copied from interface:ArtifactTypeGets the file extension to use for artifacts of this type (unless explicitly overridden by the artifact).- Specified by:
getExtensionin interfaceArtifactType- Returns:
- The usual file extension, never
null.
-
getClassifier
public java.lang.String getClassifier()
Description copied from interface:ArtifactTypeGets the classifier to use for artifacts of this type (unless explicitly overridden by the artifact).- Specified by:
getClassifierin interfaceArtifactType- Returns:
- The usual classifier or an empty string if none, never
null.
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
Description copied from interface:ArtifactTypeGets the properties to use for artifacts of this type (unless explicitly overridden by the artifact).- Specified by:
getPropertiesin interfaceArtifactType- Returns:
- The (read-only) properties, never
null. - See Also:
ArtifactProperties
-
-