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) classDSAnnotationReader.ComponentPropertyTypeDataCollector
-
Field Summary
Fields Modifier and Type Field Description (package private) Analyzeranalyzer(package private) booleanbaseclassprivate static java.util.regex.PatternBINDNAME(package private) Descriptors.TypeRefclassName(package private) ClassSignatureclassSig(package private) Clazzclazz(package private) ComponentDefcomponentprivate static InstructionCOMPONENT_INSTRprivate static InstructionCOMPONENT_PROPERTY_INSTRprivate intcomponentPropertyTypeCount(package private) intconstructorArgprivate static java.lang.StringconstructorArgFormat(package private) MethodSignatureconstructorSig(package private) Descriptors.TypeRefextendsClass(package private) FieldSignaturefieldSig(package private) XMLAttributeFinderfinder(package private) static java.util.regex.PatternIDENTIFIERTOPROPERTY(package private) Descriptors.TypeRef[]interfacesprivate static org.slf4j.Loggerlogger(package private) Clazz.FieldDefmember(package private) MultiMap<java.lang.String,Clazz.MethodDef>methods(package private) MethodSignaturemethodSig(package private) java.util.Map<java.lang.String,java.util.List<DeclarativeServicesAnnotationError>>mismatchedAnnotations(package private) java.util.Set<DSAnnotations.Options>options(package private) intparameter(package private) java.util.Map<java.lang.Object,ReferenceDef>referencesByTargetprivate static java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>unbind1private static java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>unbind2private static java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>updated1private static java.util.Map.Entry<java.util.regex.Pattern,java.lang.String>updated2static VersionV1_0static VersionV1_1static VersionV1_2static VersionV1_3static VersionV1_4static VersionVMAX(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 voidannotation(Annotation annotation)private voidcheckMapReturnType(DeclarativeServicesAnnotationError details)voidclassBegin(int access, Descriptors.TypeRef name)Are called during class parsingprivate java.lang.StringdetermineMethodReferenceType(ReferenceDef def, Clazz.MethodDef method, MethodSignature signature, java.lang.String annoService)private java.lang.StringdetermineReferenceType(ReferenceDef def, JavaTypeSignature type, ClassResolver resolver, java.lang.String annoService)private voiddoActivate(Annotation annotation)private voiddoComponent(Component comp, Annotation annotation)private voiddoDeactivate(Annotation annotation)private voiddoDesignate(Annotation annotation)private voiddoModified(Annotation annotation)private voiddoReference(Reference reference, Annotation annotation)private voiddoXmlAttribute(Annotation annotation, XMLAttribute xmlAttr)voidextendsClass(Descriptors.TypeRef name)voidfield(Clazz.FieldDef field)private ComponentDefgetDef()static ComponentDefgetDefinition(Clazz c, Analyzer analyzer, java.util.Set<DSAnnotations.Options> options, XMLAttributeFinder finder, Version minVersion)private DeclarativeServicesAnnotationErrorgetDetails(ReferenceDef def, DeclarativeServicesAnnotationError.ErrorType type)private FieldSignaturegetFieldSignature(Clazz.FieldDef field)private MethodSignaturegetMethodSignature(Clazz.MethodDef method)private voidhandleMixedUsageError(Annotation annotation)private voidhandlePossibleComponentPropertyAnnotation(Annotation annotation)voidimplementsInterfaces(Descriptors.TypeRef[] interfaces)voidmemberEnd()voidmethod(Clazz.MethodDef method)voidparameter(int p)private voidprocessActivationObject(java.lang.String propertyDefKey, ClassTypeSignature param, java.lang.String memberDescriptor, DeclarativeServicesAnnotationError details, boolean deactivate)private voidprocessConstructorActivationArgs(int toArg)extract properties from an activation objectprivate voidprocessMethodActivationArgs(java.lang.String propertyDefKeyFormat, java.lang.String memberDescriptor, DeclarativeServicesAnnotationError details, boolean deactivate)look for annotation activation objects and extract properties from themprivate java.lang.StringreferredMethod(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:
annotationin 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:
classBeginin classClassDataCollector
-
extendsClass
public void extendsClass(Descriptors.TypeRef name)
- Overrides:
extendsClassin classClassDataCollector
-
implementsInterfaces
public void implementsInterfaces(Descriptors.TypeRef[] interfaces)
- Overrides:
implementsInterfacesin classClassDataCollector
-
field
public void field(Clazz.FieldDef field)
- Overrides:
fieldin classClassDataCollector
-
getFieldSignature
private FieldSignature getFieldSignature(Clazz.FieldDef field)
-
method
public void method(Clazz.MethodDef method)
- Overrides:
methodin classClassDataCollector
-
getMethodSignature
private MethodSignature getMethodSignature(Clazz.MethodDef method)
-
memberEnd
public void memberEnd()
- Overrides:
memberEndin classClassDataCollector
-
parameter
public void parameter(int p)
- Overrides:
parameterin classClassDataCollector
-
-