Package aQute.bnd.component
Class DSAnnotationReader
- java.lang.Object
-
- aQute.bnd.osgi.ClassDataCollector
-
- aQute.bnd.component.DSAnnotationReader
-
public class DSAnnotationReader extends ClassDataCollector
Processes spec DS annotations into xml.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
DSAnnotationReader.ComponentPropertyTypeDataCollector
-
Field Summary
Fields Modifier and Type Field Description (package private) Analyzer
analyzer
(package private) boolean
baseclass
private static java.util.regex.Pattern
BINDNAME
(package private) Descriptors.TypeRef
className
(package private) ClassSignature
classSig
(package private) Clazz
clazz
(package private) ComponentDef
component
private static Instruction
COMPONENT_INSTR
private static Instruction
COMPONENT_PROPERTY_INSTR
private int
componentPropertyTypeCount
(package private) int
constructorArg
private static java.lang.String
constructorArgFormat
(package private) MethodSignature
constructorSig
(package private) Descriptors.TypeRef
extendsClass
(package private) FieldSignature
fieldSig
(package private) XMLAttributeFinder
finder
(package private) static java.util.regex.Pattern
IDENTIFIERTOPROPERTY
(package private) Descriptors.TypeRef[]
interfaces
private static org.slf4j.Logger
logger
(package private) Clazz.FieldDef
member
(package private) MultiMap<java.lang.String,Clazz.MethodDef>
methods
(package private) MethodSignature
methodSig
(package private) java.util.Map<java.lang.String,java.util.List<DeclarativeServicesAnnotationError>>
mismatchedAnnotations
(package private) java.util.Set<DSAnnotations.Options>
options
(package private) int
parameter
(package private) java.util.Map<java.lang.Object,ReferenceDef>
referencesByTarget
private static java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>
unbind1
private static java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>
unbind2
private static java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>
updated1
private static java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>
updated2
static Version
V1_0
static Version
V1_1
static Version
V1_2
static Version
V1_3
static Version
V1_4
static Version
VMAX
(package private) static java.util.Map<java.lang.String,java.lang.Class<?>>
wrappers
-
Constructor Summary
Constructors Constructor Description DSAnnotationReader(Analyzer analyzer, Clazz clazz, java.util.Set<DSAnnotations.Options> options, XMLAttributeFinder finder, Version minVersion)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
annotation(Annotation annotation)
private void
checkMapReturnType(DeclarativeServicesAnnotationError details)
void
classBegin(int access, Descriptors.TypeRef name)
Are called during class parsingprivate java.lang.String
determineMethodReferenceType(ReferenceDef def, Clazz.MethodDef method, MethodSignature signature, java.lang.String annoService)
private java.lang.String
determineReferenceType(ReferenceDef def, JavaTypeSignature type, ClassResolver resolver, java.lang.String annoService)
private void
doActivate(Annotation annotation)
private void
doComponent(Component comp, Annotation annotation)
private void
doDeactivate(Annotation annotation)
private void
doDesignate(Annotation annotation)
private void
doModified(Annotation annotation)
private void
doReference(Reference reference, Annotation annotation)
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.Set<DSAnnotations.Options> options, XMLAttributeFinder finder, Version minVersion)
private DeclarativeServicesAnnotationError
getDetails(ReferenceDef def, DeclarativeServicesAnnotationError.ErrorType type)
private FieldSignature
getFieldSignature(Clazz.FieldDef field)
private MethodSignature
getMethodSignature(Clazz.MethodDef method)
private void
handleMixedUsageError(Annotation annotation)
private void
handlePossibleComponentPropertyAnnotation(Annotation annotation)
void
implementsInterfaces(Descriptors.TypeRef[] interfaces)
void
memberEnd()
void
method(Clazz.MethodDef method)
void
parameter(int p)
private void
processActivationObject(java.lang.String propertyDefKey, ClassTypeSignature param, java.lang.String memberDescriptor, DeclarativeServicesAnnotationError details, boolean deactivate)
private void
processConstructorActivationArgs(int toArg)
extract properties from an activation objectprivate void
processMethodActivationArgs(java.lang.String propertyDefKeyFormat, java.lang.String memberDescriptor, DeclarativeServicesAnnotationError details, boolean deactivate)
look for annotation activation objects and extract properties from themprivate java.lang.String
referredMethod(Analyzer analyzer, ReferenceDef rdef, java.lang.String value, java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>... matches)
-
Methods inherited from class aQute.bnd.osgi.ClassDataCollector
addReference, annotationDefault, annotationDefault, classEnd, classStart, classStart, constant, deprecated, enclosingMethod, innerClass, methodParameters, referenceMethod, referTo, signature, typeuse, version
-
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
V1_0
public static final Version V1_0
-
V1_1
public static final Version V1_1
-
V1_2
public static final Version V1_2
-
V1_3
public static final Version V1_3
-
V1_4
public static final Version V1_4
-
VMAX
public static final Version VMAX
-
BINDNAME
private static final java.util.regex.Pattern BINDNAME
-
IDENTIFIERTOPROPERTY
static final java.util.regex.Pattern IDENTIFIERTOPROPERTY
-
COMPONENT_INSTR
private static final Instruction COMPONENT_INSTR
-
COMPONENT_PROPERTY_INSTR
private static final Instruction COMPONENT_PROPERTY_INSTR
-
wrappers
static final java.util.Map<java.lang.String,java.lang.Class<?>> wrappers
-
unbind1
private static final java.util.Map.Entry<java.util.regex.Pattern,java.lang.String> unbind1
-
unbind2
private static final java.util.Map.Entry<java.util.regex.Pattern,java.lang.String> unbind2
-
updated1
private static final java.util.Map.Entry<java.util.regex.Pattern,java.lang.String> updated1
-
updated2
private static final java.util.Map.Entry<java.util.regex.Pattern,java.lang.String> updated2
-
constructorArgFormat
private static final java.lang.String constructorArgFormat
- See Also:
- Constant Field Values
-
component
ComponentDef component
-
clazz
final Clazz clazz
-
classSig
final ClassSignature classSig
-
interfaces
Descriptors.TypeRef[] interfaces
-
member
Clazz.FieldDef member
-
methodSig
MethodSignature methodSig
-
fieldSig
FieldSignature fieldSig
-
constructorSig
MethodSignature constructorSig
-
parameter
int parameter
-
constructorArg
int constructorArg
-
className
Descriptors.TypeRef className
-
analyzer
Analyzer analyzer
-
methods
MultiMap<java.lang.String,Clazz.MethodDef> methods
-
extendsClass
Descriptors.TypeRef extendsClass
-
baseclass
boolean baseclass
-
options
final java.util.Set<DSAnnotations.Options> options
-
referencesByTarget
final java.util.Map<java.lang.Object,ReferenceDef> referencesByTarget
-
finder
final XMLAttributeFinder finder
-
mismatchedAnnotations
java.util.Map<java.lang.String,java.util.List<DeclarativeServicesAnnotationError>> mismatchedAnnotations
-
componentPropertyTypeCount
private int componentPropertyTypeCount
-
-
Constructor Detail
-
DSAnnotationReader
DSAnnotationReader(Analyzer analyzer, Clazz clazz, java.util.Set<DSAnnotations.Options> options, XMLAttributeFinder finder, Version minVersion)
-
-
Method Detail
-
getDefinition
public static ComponentDef getDefinition(Clazz c, Analyzer analyzer, java.util.Set<DSAnnotations.Options> options, XMLAttributeFinder finder, Version minVersion) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getDef
private ComponentDef getDef() throws java.lang.Exception
- Throws:
java.lang.Exception
-
referredMethod
@SafeVarargs private final java.lang.String referredMethod(Analyzer analyzer, ReferenceDef rdef, java.lang.String value, java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>... matches)
- Parameters:
analyzer
-rdef
-
-
annotation
public void annotation(Annotation annotation)
- Overrides:
annotation
in classClassDataCollector
-
handleMixedUsageError
private void handleMixedUsageError(Annotation annotation) throws java.lang.Exception
- Throws:
java.lang.Exception
-
handlePossibleComponentPropertyAnnotation
private void handlePossibleComponentPropertyAnnotation(Annotation annotation) throws java.lang.Exception
- Throws:
java.lang.Exception
-
doXmlAttribute
private void doXmlAttribute(Annotation annotation, XMLAttribute xmlAttr)
-
doDesignate
private void doDesignate(Annotation annotation)
-
doActivate
private void doActivate(Annotation annotation)
-
doDeactivate
private void doDeactivate(Annotation annotation)
-
doModified
private void doModified(Annotation annotation)
-
processMethodActivationArgs
private void processMethodActivationArgs(java.lang.String propertyDefKeyFormat, java.lang.String memberDescriptor, DeclarativeServicesAnnotationError details, boolean deactivate)
look for annotation activation objects and extract properties from them
-
processConstructorActivationArgs
private void processConstructorActivationArgs(int toArg)
extract properties from an activation object
-
processActivationObject
private void processActivationObject(java.lang.String propertyDefKey, ClassTypeSignature param, java.lang.String memberDescriptor, DeclarativeServicesAnnotationError details, boolean deactivate)
-
doReference
private void doReference(Reference reference, Annotation annotation) throws java.lang.Exception
- Parameters:
reference
-annotation
-- Throws:
java.lang.Exception
-
getDetails
private DeclarativeServicesAnnotationError getDetails(ReferenceDef def, DeclarativeServicesAnnotationError.ErrorType type)
-
determineReferenceType
private java.lang.String determineReferenceType(ReferenceDef def, JavaTypeSignature type, ClassResolver resolver, java.lang.String annoService)
-
determineMethodReferenceType
private java.lang.String determineMethodReferenceType(ReferenceDef def, Clazz.MethodDef method, MethodSignature signature, java.lang.String annoService)
-
checkMapReturnType
private void checkMapReturnType(DeclarativeServicesAnnotationError details)
-
doComponent
private void doComponent(Component comp, Annotation annotation) throws java.lang.Exception
- Parameters:
annotation
-- Throws:
java.lang.Exception
-
classBegin
public void classBegin(int access, Descriptors.TypeRef name)
Are called during class parsing- Overrides:
classBegin
in classClassDataCollector
-
extendsClass
public void extendsClass(Descriptors.TypeRef name)
- Overrides:
extendsClass
in classClassDataCollector
-
implementsInterfaces
public void implementsInterfaces(Descriptors.TypeRef[] interfaces)
- Overrides:
implementsInterfaces
in classClassDataCollector
-
field
public void field(Clazz.FieldDef field)
- Overrides:
field
in classClassDataCollector
-
getFieldSignature
private FieldSignature getFieldSignature(Clazz.FieldDef field)
-
method
public void method(Clazz.MethodDef method)
- Overrides:
method
in classClassDataCollector
-
getMethodSignature
private MethodSignature getMethodSignature(Clazz.MethodDef method)
-
memberEnd
public void memberEnd()
- Overrides:
memberEnd
in classClassDataCollector
-
parameter
public void parameter(int p)
- Overrides:
parameter
in classClassDataCollector
-
-