se.jbee.inject
Class Dependency<T>
Object
se.jbee.inject.Dependency<T>
- All Implemented Interfaces:
- Iterable<Injection>, Named, Parameter<T>, Typed<T>
public final class Dependency<T>
- extends Object
- implements Named, Parameter<T>, Iterable<Injection>
Describes what is wanted/needed as parameter to construct a instance of T.
- Author:
- Jan Bernitt (jan@jbee.se)
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
dependency
public static <T> Dependency<T> dependency(Class<T> type)
dependency
public static <T> Dependency<T> dependency(Type<T> type)
dependency
public static <T> Dependency<T> dependency(Instance<T> instance)
getInstance
public Instance<T> getInstance()
getType
public Type<T> getType()
- Specified by:
getType in interface Typed<T>
- Returns:
- The
Type of this object.
getName
public Name getName()
- Specified by:
getName in interface Named
- Returns:
- the name of an
Instance / Resource.
toString
public String toString()
- Overrides:
toString in class Object
onTypeParameter
public Dependency<?> onTypeParameter()
instanced
public <E> Dependency<E> instanced(Instance<E> instance)
typed
public <E> Dependency<E> typed(Type<E> type)
- Specified by:
typed in interface Typed<T>
- Returns:
- This object with the given
Type.
anyTyped
public <E> Dependency<E> anyTyped(Type<E> type)
anyTyped
public <E> Dependency<E> anyTyped(Class<E> type)
named
public Dependency<T> named(String name)
named
public Dependency<T> named(Name name)
untargeted
public Dependency<T> untargeted()
ignoredExpiry
public Dependency<T> ignoredExpiry()
isUntargeted
public boolean isUntargeted()
target
public Instance<?> target()
target
public Instance<?> target(int level)
injectionDepth
public int injectionDepth()
injectingInto
public Dependency<T> injectingInto(Class<?> target)
- Means we inject into the argument target class.
injectingInto
public Dependency<T> injectingInto(Type<?> target)
injectingInto
public Dependency<T> injectingInto(Instance<?> target)
injectingInto
public Dependency<T> injectingInto(Emergence<?> target)
uninject
public Dependency<T> uninject()
isAssignableTo
public boolean isAssignableTo(Type<?> type)
- Specified by:
isAssignableTo in interface Parameter<T>
iterator
public Iterator<Injection> iterator()
- Specified by:
iterator in interface Iterable<Injection>