org.springframework.roo.project
Class Dependency

java.lang.Object
  extended by org.springframework.roo.project.Dependency
All Implemented Interfaces:
Comparable<Dependency>

public class Dependency
extends Object
implements Comparable<Dependency>

Simplified immutable representation of a dependency.

Structured after the model used by Maven and Ivy. This may be replaced in a future release with a more OSGi-centric model.

Since:
1.0
Author:
Ben Alex, Stefan Schmidt, Alan Stewart

Constructor Summary
Dependency(Element dependency)
          Convenience constructor when an XML element is available that represents a Maven .
Dependency(org.springframework.roo.model.JavaPackage groupId, org.springframework.roo.model.JavaSymbolName artifactId, String versionId, DependencyType type, DependencyScope scope)
          Creates an immutable Dependency.
Dependency(String groupId, String artifactId, String version)
          Convenience constructor for producing a JAR dependency.
Dependency(String groupId, String artifactId, String version, List<Dependency> exclusions)
          Convenience constructor for producing a JAR dependency.
 
Method Summary
 int compareTo(Dependency o)
           
 boolean equals(Object obj)
           
 org.springframework.roo.model.JavaSymbolName getArtifactId()
           
 List<Dependency> getExclusions()
           
 org.springframework.roo.model.JavaPackage getGroupId()
           
 DependencyScope getScope()
           
 String getSimpleDescription()
           
 String getSystemPath()
           
 DependencyType getType()
           
 String getVersionId()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dependency

public Dependency(String groupId,
                  String artifactId,
                  String version)
Convenience constructor for producing a JAR dependency.

Parameters:
groupId - the group ID (required)
artifactId - the artifact ID (required)
version - the version (required)

Dependency

public Dependency(String groupId,
                  String artifactId,
                  String version,
                  List<Dependency> exclusions)
Convenience constructor for producing a JAR dependency.

Parameters:
groupId - the group ID (required)
artifactId - the artifact ID (required)
version - the version ID (required)
exclusions - the exclusions for this dependency

Dependency

public Dependency(Element dependency)
Convenience constructor when an XML element is available that represents a Maven .

Parameters:
dependency - to parse (required)

Dependency

public Dependency(org.springframework.roo.model.JavaPackage groupId,
                  org.springframework.roo.model.JavaSymbolName artifactId,
                  String versionId,
                  DependencyType type,
                  DependencyScope scope)
Creates an immutable Dependency.

Parameters:
groupId - the group ID (required)
artifactId - the artifact ID (required)
versionId - the version ID (required)
type - the dependency type (required)
scope - the dependency scope (required)
Method Detail

getGroupId

public org.springframework.roo.model.JavaPackage getGroupId()

getArtifactId

public org.springframework.roo.model.JavaSymbolName getArtifactId()

getVersionId

public String getVersionId()

getType

public DependencyType getType()

getScope

public DependencyScope getScope()

getSystemPath

public String getSystemPath()

getExclusions

public List<Dependency> getExclusions()
Returns:
list of exclusions (never null)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public int compareTo(Dependency o)
Specified by:
compareTo in interface Comparable<Dependency>

getSimpleDescription

public String getSimpleDescription()
Returns:
a simple description, as would be used for console output

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2010 VMware, Inc. All Rights Reserved.