org.mevenide.repository
Class RepoPathElement

java.lang.Object
  extended by org.mevenide.repository.RepoPathElement

public final class RepoPathElement
extends java.lang.Object

Data placeholder for local and remote repository information. Can contain incomplete values, the means of getting more complete data is calling getChildren()

Author:
Milos Kleint (mkleint@codehaus.org)

Field Summary
static int LEVEL_ARTIFACT
          constant returned from getLevel() denotes an instance that has at least the groupId, type and artifactId filled out.
static int LEVEL_GROUP
          constant returned from getLevel(), denotes an instance that has at least the groupId filled out.
static int LEVEL_ROOT
          constant returned from getLevel(), denotes an instance that has nothing filled out.
static int LEVEL_TYPE
          constant returned from getLevel() denotes an instance that has at least the groupId and type filled out.
static int LEVEL_VERSION
          constant returned from getLevel() denotes an instance that has all fields filled out.
 
Constructor Summary
RepoPathElement(IRepositoryReader reader)
          Creates a new instance of RepoPathElement
RepoPathElement(IRepositoryReader reader, RepoPathElement parent)
          Creates a new instance of RepoPathElement
RepoPathElement(IRepositoryReader read, RepoPathElement parent, java.lang.String groupId, java.lang.String type, java.lang.String version, java.lang.String artifactId, java.lang.String ext)
           
 
Method Summary
 java.lang.String getArtifactId()
           
 RepoPathElement[] getChildren()
          Get an array of RepoPathElements that share the fields of the current one and have additional differentiating information.
 java.lang.String getExtension()
           
 java.lang.String getGroupId()
           
 int getLevel()
           
 RepoPathElement getParent()
           
 IRepositoryReader getReader()
           
 java.lang.String getRelativeURIPath()
          Get path to artifact relative to the root of repository.
 java.net.URI getRootURI()
          Returns the absolute URI to the root repository of this element.
 java.lang.String getType()
           
 java.net.URI getURI()
          Returns the absolute URI to this element.
 java.lang.String getVersion()
           
 boolean isLeaf()
          Returns true if all it's fields are filled out, identifying the artifact in an exact manner.
 boolean isLoaded()
           
 boolean isRemote()
           
 boolean isRoot()
          Returns true if this node represents the root repository.
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEVEL_ROOT

public static final int LEVEL_ROOT
constant returned from getLevel(), denotes an instance that has nothing filled out.

value = 0

See Also:
Constant Field Values

LEVEL_GROUP

public static final int LEVEL_GROUP
constant returned from getLevel(), denotes an instance that has at least the groupId filled out.

value = 1

See Also:
Constant Field Values

LEVEL_TYPE

public static final int LEVEL_TYPE
constant returned from getLevel() denotes an instance that has at least the groupId and type filled out.

value = 2

See Also:
Constant Field Values

LEVEL_ARTIFACT

public static final int LEVEL_ARTIFACT
constant returned from getLevel() denotes an instance that has at least the groupId, type and artifactId filled out.

value = 3

See Also:
Constant Field Values

LEVEL_VERSION

public static final int LEVEL_VERSION
constant returned from getLevel() denotes an instance that has all fields filled out.

value = 4

See Also:
Constant Field Values
Constructor Detail

RepoPathElement

public RepoPathElement(IRepositoryReader reader)
Creates a new instance of RepoPathElement


RepoPathElement

public RepoPathElement(IRepositoryReader reader,
                       RepoPathElement parent)
Creates a new instance of RepoPathElement


RepoPathElement

public RepoPathElement(IRepositoryReader read,
                       RepoPathElement parent,
                       java.lang.String groupId,
                       java.lang.String type,
                       java.lang.String version,
                       java.lang.String artifactId,
                       java.lang.String ext)
Method Detail

getParent

public RepoPathElement getParent()

getGroupId

public java.lang.String getGroupId()

getArtifactId

public java.lang.String getArtifactId()

getVersion

public java.lang.String getVersion()

getType

public java.lang.String getType()

getExtension

public java.lang.String getExtension()

isLeaf

public boolean isLeaf()
Returns true if all it's fields are filled out, identifying the artifact in an exact manner.


isRoot

public boolean isRoot()
Returns true if this node represents the root repository.


getLevel

public int getLevel()

getRelativeURIPath

public java.lang.String getRelativeURIPath()
Get path to artifact relative to the root of repository. Really only makes sense for leaf elements.


getRootURI

public java.net.URI getRootURI()
Returns the absolute URI to the root repository of this element. Makes the most sense for leaf elements.


getURI

public java.net.URI getURI()
Returns the absolute URI to this element. Makes the most sense for leaf elements.


getChildren

public RepoPathElement[] getChildren()
                              throws java.lang.Exception
Get an array of RepoPathElements that share the fields of the current one and have additional differentiating information. Eg. for an instance with specified groupId will return an array with same groupId and the all existing types.

Throws:
java.lang.Exception

isRemote

public boolean isRemote()

getReader

public IRepositoryReader getReader()

reset

public void reset()

isLoaded

public boolean isLoaded()


Copyright © 2003-2005 The Codehaus. All Rights Reserved.