|
Silk DI 0.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objectse.jbee.inject.bootstrap.Inspect
public class Inspect
The basic Inspector implementations. It allows to chose Constructors and
Methods based on the Annotations present, the Types a method returns or
the Packages they are defined in.
| Field Summary | |
|---|---|
static Inspect |
DEFAULT
By default just the constructor is inspected. |
| Method Summary | ||
|---|---|---|
static Inspect |
all()
|
|
static Inspect |
allStatic()
|
|
Inspect |
annotatedWith(Class<? extends Annotation> annotation)
|
|
|
constructorFor(Class<T> type)
Picks the Constructor to use to construct objects of a given Class. |
|
Inspect |
constructors()
|
|
static
|
defaultConstructor(Class<T> declaringClass)
Returns the constructor usually should be used. |
|
Inspect |
methods()
|
|
|
methodsIn(Class<T> implementor)
|
|
static Inspect |
methodsReturn(Type<?> returnType)
|
|
Inspect |
namedBy(Class<? extends Annotation> annotation)
|
|
Name |
nameFor(AccessibleObject obj)
|
|
static
|
noArgsConstructor(Class<T> declaringClass)
|
|
Parameter<?>[] |
parametersFor(AccessibleObject obj)
|
|
Inspect |
returnTypeAssignableTo(Type<?> supertype)
|
|
Inspect |
returnTypeIn(Packages packages)
|
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Inspect DEFAULT
Inspector will pick the
defaultConstructor(Class).
| Method Detail |
|---|
public static Inspect all()
Inspector that will result in all methods and a constructor for all given
implementation classes. The result can be further restricted using any combination of
the instance methods of Inject.public static Inspect allStatic()
all() but result is already restricted to just static methods.public static Inspect methodsReturn(Type<?> returnType)
public Parameter<?>[] parametersFor(AccessibleObject obj)
parametersFor in interface InspectorParameter hints for the construction/invocation of the given object. Use
a zero length array if there are no hits.public Name nameFor(AccessibleObject obj)
nameFor in interface InspectorName of the instance provided by the given object. Use
Name.DEFAULT for no specific name.public <T> Constructor<T> constructorFor(Class<T> type)
InspectorConstructor to use to construct objects of a given Class.
constructorFor in interface InspectorConstructor considered to be the reasonable or right way to construct a
object of the given type. In case one with parameters is returned the process will
try to resolve them.public <T> Method[] methodsIn(Class<T> implementor)
methodsIn in interface InspectorMembers that should be bound from the given implementor.public Inspect methods()
Inspector restricted to inspect just methods (no constructors).public Inspect constructors()
Inspector restricted to inspect just constructors (no methods).public Inspect annotatedWith(Class<? extends Annotation> annotation)
annotation - An annotation available at runtime
Inspector restricted to inspect just constructors and/or methods where the
given annotation is present.public Inspect namedBy(Class<? extends Annotation> annotation)
annotation - An annotation available at runtime having at least one property of type
String.
Inspector that tries to extract an instance name from the given annotation.public Inspect returnTypeIn(Packages packages)
packages - The set of Packages the return type of a method or the class constructed
by a constructor should be contained in.
Inspector restricted to inspect just methods having a return type or a
constructor of a type that is a member of the set given.public Inspect returnTypeAssignableTo(Type<?> supertype)
supertype - any Type
Inspector restricted to inspect just methods or constructors that return a
Type that is assignable to the given super-type.public static <T> Constructor<T> defaultConstructor(Class<T> declaringClass)
declaringClass - constructed type
NoSuchMethodException - in case the type is not constructible (has no constructors at all)public static <T> Constructor<T> noArgsConstructor(Class<T> declaringClass)
|
Silk DI 0.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||