public class AnnotationReader extends ClassDataCollector
Modifier and Type | Class and Description |
---|---|
private class |
AnnotationReader.ComponentPropertyTypeDataCollector |
Modifier and Type | Field and Description |
---|---|
(package private) Analyzer |
analyzer |
(package private) boolean |
baseclass |
(package private) static java.util.regex.Pattern |
BINDDESCRIPTORDS10 |
(package private) static java.util.regex.Pattern |
BINDDESCRIPTORDS11 |
(package private) static java.util.regex.Pattern |
BINDDESCRIPTORDS13 |
(package private) static java.util.regex.Pattern |
BINDNAME |
(package private) Descriptors.TypeRef |
className |
(package private) Clazz |
clazz |
(package private) ComponentDef |
component |
(package private) static java.util.regex.Pattern |
DEACTIVATEDESCRIPTORDS11 |
(package private) static java.util.regex.Pattern |
DEACTIVATEDESCRIPTORDS13 |
(package private) static Descriptors.TypeRef[] |
EMPTY |
(package private) Descriptors.TypeRef |
extendsClass |
(package private) XMLAttributeFinder |
finder |
(package private) static java.util.regex.Pattern |
IDENTIFIERTOPROPERTY |
(package private) Descriptors.TypeRef[] |
interfaces |
(package private) static java.util.regex.Pattern |
LIFECYCLEARGUMENT |
(package private) static java.util.regex.Pattern |
LIFECYCLEDESCRIPTORDS10 |
(package private) static java.util.regex.Pattern |
LIFECYCLEDESCRIPTORDS11 |
(package private) static java.util.regex.Pattern |
LIFECYCLEDESCRIPTORDS13 |
(package private) Clazz.FieldDef |
member |
(package private) MultiMap<java.lang.String,Clazz.MethodDef> |
methods |
(package private) java.util.Map<java.lang.String,java.util.List<DeclarativeServicesAnnotationError>> |
mismatchedAnnotations |
(package private) java.util.EnumSet<DSAnnotations.Options> |
options |
(package private) static java.util.regex.Pattern |
PROPERTY_PATTERN |
(package private) java.util.Map<Clazz.FieldDef,ReferenceDef> |
referencesByMember |
static Version |
V1_0 |
static Version |
V1_1 |
static Version |
V1_2 |
static Version |
V1_3 |
static Version |
V1_4 |
(package private) static java.util.Map<java.lang.String,java.lang.Class<?>> |
wrappers |
Constructor and Description |
---|
AnnotationReader(Analyzer analyzer,
Clazz clazz,
java.util.EnumSet<DSAnnotations.Options> options,
XMLAttributeFinder finder,
Version minVersion) |
Modifier and Type | Method and Description |
---|---|
void |
annotation(Annotation annotation) |
private void |
checkMapReturnType(boolean hasMapReturnType,
DeclarativeServicesAnnotationError details) |
void |
classBegin(int access,
Descriptors.TypeRef name)
Are called during class parsing
|
void |
classEnd() |
private java.lang.String |
determineReferenceType(java.lang.String methodDescriptor,
ReferenceDef def,
java.lang.String annoService,
java.lang.String signature) |
protected void |
doActivate() |
protected void |
doComponent(org.osgi.service.component.annotations.Component comp,
Annotation annotation) |
protected void |
doDeactivate() |
protected void |
doDesignate(org.osgi.service.metatype.annotations.Designate a) |
protected void |
doModified() |
private void |
doProperty(java.lang.String[] properties)
Parse the properties
|
protected void |
doReference(org.osgi.service.component.annotations.Reference reference,
Annotation raw) |
private void |
doXmlAttribute(Annotation annotation,
XMLAttribute xmlAttr) |
void |
extendsClass(Descriptors.TypeRef name) |
void |
field(Clazz.FieldDef field) |
private ComponentDef |
getDef() |
static ComponentDef |
getDefinition(Clazz c,
Analyzer analyzer,
java.util.EnumSet<DSAnnotations.Options> options,
XMLAttributeFinder finder,
Version minVersion) |
private DeclarativeServicesAnnotationError |
getDetails(ReferenceDef def,
DeclarativeServicesAnnotationError.ErrorType type) |
private void |
handleMixedUsageError(Annotation annotation) |
void |
implementsInterfaces(Descriptors.TypeRef[] interfaces) |
void |
memberEnd() |
void |
method(Clazz.MethodDef method) |
private boolean |
noMatch(java.lang.String annoService,
java.lang.String inferredService) |
private void |
processAnnotationArguments(java.lang.String methodDescriptor,
DeclarativeServicesAnnotationError details)
look for annotation arguments and extract properties from them
|
protected java.lang.String |
referredMethod(Analyzer analyzer,
ReferenceDef rdef,
java.lang.String value,
java.lang.String... matches) |
private boolean |
sufficientGenerics(int index,
int sigLength,
ReferenceDef def,
java.lang.String sig) |
addReference, annotationDefault, annotationDefault, classStart, classStart, constant, deprecated, enclosingMethod, innerClass, parameter, referenceMethod, referTo, signature, version
static final Descriptors.TypeRef[] EMPTY
static final java.util.regex.Pattern PROPERTY_PATTERN
public static final Version V1_0
public static final Version V1_1
public static final Version V1_2
public static final Version V1_3
public static final Version V1_4
static final java.util.regex.Pattern BINDNAME
static final java.util.regex.Pattern BINDDESCRIPTORDS10
static final java.util.regex.Pattern BINDDESCRIPTORDS11
static final java.util.regex.Pattern BINDDESCRIPTORDS13
static final java.util.regex.Pattern LIFECYCLEDESCRIPTORDS10
static final java.util.regex.Pattern LIFECYCLEDESCRIPTORDS11
static final java.util.regex.Pattern LIFECYCLEDESCRIPTORDS13
static final java.util.regex.Pattern LIFECYCLEARGUMENT
static final java.util.regex.Pattern IDENTIFIERTOPROPERTY
static final java.util.regex.Pattern DEACTIVATEDESCRIPTORDS11
static final java.util.regex.Pattern DEACTIVATEDESCRIPTORDS13
static final java.util.Map<java.lang.String,java.lang.Class<?>> wrappers
ComponentDef component
Clazz clazz
Descriptors.TypeRef[] interfaces
Clazz.FieldDef member
Descriptors.TypeRef className
Analyzer analyzer
MultiMap<java.lang.String,Clazz.MethodDef> methods
Descriptors.TypeRef extendsClass
boolean baseclass
final java.util.EnumSet<DSAnnotations.Options> options
final java.util.Map<Clazz.FieldDef,ReferenceDef> referencesByMember
final XMLAttributeFinder finder
java.util.Map<java.lang.String,java.util.List<DeclarativeServicesAnnotationError>> mismatchedAnnotations
AnnotationReader(Analyzer analyzer, Clazz clazz, java.util.EnumSet<DSAnnotations.Options> options, XMLAttributeFinder finder, Version minVersion)
public static ComponentDef getDefinition(Clazz c, Analyzer analyzer, java.util.EnumSet<DSAnnotations.Options> options, XMLAttributeFinder finder, Version minVersion) throws java.lang.Exception
java.lang.Exception
private ComponentDef getDef() throws java.lang.Exception
java.lang.Exception
protected java.lang.String referredMethod(Analyzer analyzer, ReferenceDef rdef, java.lang.String value, java.lang.String... matches)
analyzer
- rdef
- public void classEnd() throws java.lang.Exception
classEnd
in class ClassDataCollector
java.lang.Exception
public void memberEnd()
memberEnd
in class ClassDataCollector
public void annotation(Annotation annotation)
annotation
in class ClassDataCollector
private void handleMixedUsageError(Annotation annotation) throws java.lang.Exception
java.lang.Exception
private void doXmlAttribute(Annotation annotation, XMLAttribute xmlAttr)
protected void doDesignate(org.osgi.service.metatype.annotations.Designate a)
protected void doActivate()
protected void doDeactivate()
protected void doModified()
private void processAnnotationArguments(java.lang.String methodDescriptor, DeclarativeServicesAnnotationError details)
methodDescriptor
- fqn
- TODOmethod
- TODOdescriptor
- TODOprotected void doReference(org.osgi.service.component.annotations.Reference reference, Annotation raw) throws java.lang.Exception
reference
- @Reference proxy backed by raw.raw
- @Reference contentsjava.lang.Exception
private DeclarativeServicesAnnotationError getDetails(ReferenceDef def, DeclarativeServicesAnnotationError.ErrorType type)
private boolean sufficientGenerics(int index, int sigLength, ReferenceDef def, java.lang.String sig)
private java.lang.String determineReferenceType(java.lang.String methodDescriptor, ReferenceDef def, java.lang.String annoService, java.lang.String signature)
private void checkMapReturnType(boolean hasMapReturnType, DeclarativeServicesAnnotationError details)
private boolean noMatch(java.lang.String annoService, java.lang.String inferredService)
annoService
- inferredService
- protected void doComponent(org.osgi.service.component.annotations.Component comp, Annotation annotation) throws java.lang.Exception
annotation
- java.lang.Exception
private void doProperty(java.lang.String[] properties)
public void classBegin(int access, Descriptors.TypeRef name)
classBegin
in class ClassDataCollector
public void implementsInterfaces(Descriptors.TypeRef[] interfaces)
implementsInterfaces
in class ClassDataCollector
public void method(Clazz.MethodDef method)
method
in class ClassDataCollector
public void field(Clazz.FieldDef field)
field
in class ClassDataCollector
public void extendsClass(Descriptors.TypeRef name)
extendsClass
in class ClassDataCollector