public class BeanSpec extends Object implements org.osgl.util.AnnotationAware
Specification of a bean to be injected
| Modifier and Type | Method and Description |
|---|---|
Annotation[] |
allAnnotations() |
boolean |
equals(Object obj)
A bean spec equals to another bean spec if all of the following conditions are met: * the
type of the two bean spec equals to each other * the annotations of the two bean spec equals to each other |
<T extends Annotation> |
getAnnotation(Class<T> annoClass) |
int |
getModifiers() |
boolean |
hasAnnotation() |
boolean |
hasAnnotation(Class<? extends Annotation> annoClass) |
int |
hashCode() |
Injector |
injector() |
boolean |
isArray() |
boolean |
isFinal() |
boolean |
isInstance(Object o) |
boolean |
isInstanceOf(Class c) |
boolean |
isPrivate() |
boolean |
isProtected() |
boolean |
isPublic() |
boolean |
isStatic() |
boolean |
isTransient() |
String |
name() |
static BeanSpec |
of(Class<?> clazz,
Injector injector) |
static BeanSpec |
of(Field field,
Injector injector) |
static BeanSpec |
of(Type type,
Annotation[] paramAnnotations,
Injector injector) |
static BeanSpec |
of(Type type,
Annotation[] paramAnnotations,
Injector injector,
int modifiers) |
static BeanSpec |
of(Type type,
Annotation[] paramAnnotations,
String name,
Injector injector) |
static BeanSpec |
of(Type type,
Annotation[] paramAnnotations,
String name,
Injector injector,
int modifiers) |
Set<Annotation> |
qualifiers() |
Class |
rawType() |
static Class<?> |
rawTypeOf(Type type) |
BeanSpec |
toList()
Convert an array bean spec to a list bean spec
|
String |
toString() |
Type |
type() |
List<Type> |
typeParams() |
public boolean equals(Object obj)
A bean spec equals to another bean spec if all of the following conditions are met: * the type of the two bean spec equals to each other * the annotations of the two bean spec equals to each other
Specifically, scope does not participate comparison because 1. Scope annotations shall be put onto type, or the factory method with Provides annotation, which is equivalent to Type. So it is safe to ignore scope annotation because one type cannot be annotated with different scope 2. If we count scope annotation in equality test, we will never be able to get the correct provider stem from the factory methods.
public Injector injector()
public Type type()
public Class rawType()
public String name()
public boolean isArray()
public Annotation[] allAnnotations()
public BeanSpec toList()
Convert an array bean spec to a list bean spec
public <T extends Annotation> T getAnnotation(Class<T> annoClass)
getAnnotation in interface org.osgl.util.AnnotationAwarepublic boolean hasAnnotation(Class<? extends Annotation> annoClass)
hasAnnotation in interface org.osgl.util.AnnotationAwarepublic boolean hasAnnotation()
public int getModifiers()
public boolean isTransient()
public boolean isStatic()
public boolean isPrivate()
public boolean isPublic()
public boolean isProtected()
public boolean isFinal()
public boolean isInstanceOf(Class c)
public boolean isInstance(Object o)
public Set<Annotation> qualifiers()
public static BeanSpec of(Type type, Annotation[] paramAnnotations, Injector injector)
public static BeanSpec of(Type type, Annotation[] paramAnnotations, Injector injector, int modifiers)
public static BeanSpec of(Type type, Annotation[] paramAnnotations, String name, Injector injector)
public static BeanSpec of(Type type, Annotation[] paramAnnotations, String name, Injector injector, int modifiers)
Copyright © 2017. All Rights Reserved.