org.jdtaus.core.container
Class Dependency

java.lang.Object
  extended by org.jdtaus.core.container.ModelObject
      extended by org.jdtaus.core.container.Dependency
All Implemented Interfaces:
Serializable, Cloneable

public class Dependency
extends ModelObject
implements Cloneable, Serializable

Dependency meta-data.

A dependency consists of a name uniquely identifying the dependency in a set of dependencies and pairs a specification with corresponding implementations from a set of available implementations. Properties set with a dependency overwrite properties of the dependency's specification. The bound flag indicates if the instance of the dependency is bound to the declaring implementation.

Version:
$Id: Dependency.java 8044 2009-07-02 01:29:05Z schulte2005 $
Author:
Christian Schulte
See Also:
Serialized Form

Constructor Summary
Dependency()
           
 
Method Summary
 Object clone()
          Creates and returns a copy of this object.
 boolean equals(Object o)
          Indicates whether some other object is equal to this one by comparing the values of all properties.
 Properties getDeclaredProperties()
          Gets the declared properties of the dependency.
 Implementation getImplementation()
          Gets the implementation of the dependency.
 String getName()
          Gets the name of the dependency.
 Properties getProperties()
          Gets the properties of the dependency.
 Specification getSpecification()
          Gets the specification of the dependency.
 int hashCode()
          Returns a hash code value for this object.
 boolean isBound()
          Gets the flag indicating if the dependency is bound to a requesting implementation.
 void setBound(boolean value)
          Setter for property bound.
 void setImplementation(Implementation value)
          Setter for property implementation.
 void setName(String value)
          Setter for property name.
 void setProperties(Properties value)
          Setter for property properties.
 void setSpecification(Specification value)
          Setter for property specification.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.jdtaus.core.container.ModelObject
getDocumentation, getModelVersion, setDocumentation, setModelVersion
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Dependency

public Dependency()
Method Detail

clone

public Object clone()
Creates and returns a copy of this object. This method performs a "shallow copy" of this object, not a "deep copy" operation.

Overrides:
clone in class Object
Returns:
a clone of this instance.

equals

public boolean equals(Object o)
Indicates whether some other object is equal to this one by comparing the values of all properties.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as o; false otherwise.

getDeclaredProperties

public Properties getDeclaredProperties()
Gets the declared properties of the dependency.

Returns:
the declared properties of the dependency.

getImplementation

public Implementation getImplementation()
Gets the implementation of the dependency.

Returns:
the implementation of the dependency or null.

getName

public String getName()
Gets the name of the dependency.

Returns:
the name of the dependency.

getProperties

public Properties getProperties()
Gets the properties of the dependency.

The properties of a dependency are a merged set of the properties declared for the dependency's implementation overwritten by any properties declared for the dependency.

Returns:
the properties of the dependency.
Throws:
IllegalPropertyTypeException - for any property type collisions during merging.
See Also:
PropertyOverwriteConstraintException

getSpecification

public Specification getSpecification()
Gets the specification of the dependency.

Returns:
the specification of the dependency.

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

isBound

public boolean isBound()
Gets the flag indicating if the dependency is bound to a requesting implementation.

Returns:
true if the dependency object is bound to the declaring implementation; false if not.

setBound

public void setBound(boolean value)
Setter for property bound.

Parameters:
value - true if the dependency object should be bound to the declaring implementation; false if not.

setImplementation

public void setImplementation(Implementation value)
Setter for property implementation.

Parameters:
value - the new implementation of the dependency.

setName

public void setName(String value)
Setter for property name.

Parameters:
value - the new name of the dependency.

setProperties

public void setProperties(Properties value)
Setter for property properties.

Parameters:
value - the new properties of the dependency.
See Also:
PropertyOverwriteConstraintException

setSpecification

public void setSpecification(Specification value)
Setter for property specification.

Parameters:
value - the new specification of the dependency.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.


Copyright © 2005-2009 jDTAUS. All Rights Reserved.