org.apache.avalon.tools.model
Class Info

java.lang.Object
  extended byorg.apache.avalon.tools.model.Info

public class Info
extends Object

Project info.

Version:
$Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
Author:
Avalon Development Team

Field Summary
static String PROTOCOL
          The static immutable value of the artifact protocol.
static String SNAPSHOT
          The static immutable element value to declare a SNAPSHOT artifact.
 
Method Summary
static Info create(Home home, String id)
          Creation of a new info instance relative to a supplied home and artifact specification.
static Info create(Home home, String type, String id)
          Creation of a new info instance relative to a supplied home, type, and artifact specification.
static Info create(Home home, String group, String name, String version, String type, boolean snapshot)
          Creation of a new info instance relative to a supplied set of parameters.
 boolean equals(Object other)
          Return true if this info instance is equal to the supplied object.
 String getFilename()
          Return the full filename of the artifact.
 String getGroup()
          Return the name of the artifact group.
 String getName()
          Return the name of the artifact.
 String getPath()
          Return the path to the artifact.
 String getShortFilename()
          Return a string corresponding to the name and version of this artifact without type information.
 String getSpec()
          Return the artifact specification.
 String getSpecification(String groupSeparator, String versionSeparator)
          Return the artifact specification using the supplied group and version separators.
 String getType()
          Return a string identifying the aritfact type.
 String getURI()
          Return the artifact uri.
 String getVersion()
          Return the version identifier.
 boolean isaSnapshot()
          Return the snapshot staus of this artifact.
 String toString()
          Return the string representation of this info instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SNAPSHOT

public static final String SNAPSHOT
The static immutable element value to declare a SNAPSHOT artifact.

See Also:
Constant Field Values

PROTOCOL

public static final String PROTOCOL
The static immutable value of the artifact protocol.

See Also:
Constant Field Values
Method Detail

create

public static Info create(Home home,
                          String id)
Creation of a new info instance relative to a supplied home and artifact specification.

Parameters:
home - the home
id - the artiact identifier
Returns:
the immutable info descriptor

create

public static Info create(Home home,
                          String type,
                          String id)
Creation of a new info instance relative to a supplied home, type, and artifact specification.

Parameters:
home - the home
type - the artifact type
id - the artiact identifier
Returns:
the immutable info descriptor

create

public static Info create(Home home,
                          String group,
                          String name,
                          String version,
                          String type,
                          boolean snapshot)
Creation of a new info instance relative to a supplied set of parameters.

Parameters:
home - the home
group - the artifact group
name - the artifact name
version - the artifact version
type - the artifact type
snapshot - the artiact snapshot status
Returns:
the immutable info descriptor

getGroup

public String getGroup()
Return the name of the artifact group.

Returns:
the group name

getName

public String getName()
Return the name of the artifact.

Returns:
the artifact name

getVersion

public String getVersion()
Return the version identifier. If the build policy is SNAPSHOT the version value returned is replaced with "SNAPSHOT".

Returns:
a string identifying the build version.

isaSnapshot

public boolean isaSnapshot()
Return the snapshot staus of this artifact.

Returns:
true if this artifact is marked as a snapshot

getType

public String getType()
Return a string identifying the aritfact type.

Returns:
the artifact type

getShortFilename

public String getShortFilename()
Return a string corresponding to the name and version of this artifact without type information.

Returns:
the artifact short name

getFilename

public String getFilename()
Return the full filename of the artifact. The value returned is in the form [name]-[version].[type] or in the case of a null version [name].[type].

Returns:
the artifact filename

getPath

public String getPath()
Return the path to the artifact. The path is returned in the form [group]/[type]s/[filename].

Returns:
the artifact relative path

getURI

public String getURI()
Return the artifact uri. The path is returned in the form "artifact:[type]:[spec].

Returns:
the artifact uri

getSpec

public String getSpec()
Return the artifact specification. The path is retured in the form [group]/[name]#[version].

Returns:
the artifact spec

getSpecification

public String getSpecification(String groupSeparator,
                               String versionSeparator)
Return the artifact specification using the supplied group and version separators.

Parameters:
groupSeparator - the group separator
versionSeparator - the version separator
Returns:
a derived specification

toString

public String toString()
Return the string representation of this info instance.

Returns:
a string representation

equals

public boolean equals(Object other)
Return true if this info instance is equal to the supplied object.

Parameters:
other - the object to compare against this instance
Returns:
TRUE if equal