|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rafa.dep.SimpleDependency
public class SimpleDependency
Class describing a very simple dependency on another object.
Field Summary | |
---|---|
protected java.util.List<Dependent> |
path
Dependency path, i.e. |
protected java.util.Map<java.lang.Object,java.lang.Object> |
properties
Any properties with details on the dependency. |
protected java.lang.Object |
target
The needed dependency itself. |
Constructor Summary | |
---|---|
SimpleDependency(java.lang.Object target)
|
|
SimpleDependency(java.lang.Object target,
java.util.Map<java.lang.Object,java.lang.Object> properties)
|
Method Summary | |
---|---|
void |
addProperty(java.lang.Object key,
java.lang.Object value)
Adds a property to describe this dependency, overwriting it in case it already exists. |
java.util.List<Dependent> |
getPath()
|
java.util.Map<java.lang.Object,java.lang.Object> |
getProperties()
|
java.lang.Object |
getTarget()
|
protected SimpleDependency |
mergeWith(Dependency subDep)
Merges this dependency with another one. |
java.util.Collection<Dependency> |
search(java.lang.Object subTarget)
Searches a sub-dependency within this object's target. |
java.lang.String |
toString()
|
void |
validateCircularDependency()
Checks that a dependency held by an object on itself is valid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object target
protected java.util.List<Dependent> path
protected java.util.Map<java.lang.Object,java.lang.Object> properties
Constructor Detail |
---|
public SimpleDependency(java.lang.Object target)
public SimpleDependency(java.lang.Object target, java.util.Map<java.lang.Object,java.lang.Object> properties)
Method Detail |
---|
public java.lang.Object getTarget()
getTarget
in interface Dependency
public java.util.List<Dependent> getPath()
getPath
in interface Dependency
null
if this is a direct dependency.protected SimpleDependency mergeWith(Dependency subDep)
subDep
- a subdependency from this one's target (which must necessarily
be a Dependent
instance).
public void addProperty(java.lang.Object key, java.lang.Object value)
addProperty
in interface Dependency
key
- value
- public java.util.Map<java.lang.Object,java.lang.Object> getProperties()
getProperties
in interface Dependency
public java.util.Collection<Dependency> search(java.lang.Object subTarget)
Dependency
search
in interface Dependency
subTarget
- the searched object.
null
if none found.public void validateCircularDependency() throws CircularDependencyException
validateCircularDependency
in interface Dependency
CircularDependencyException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |