Stuart McCulloch | 26e7a5a | 2011-10-17 10:31:43 +0000 | [diff] [blame^] | 1 | package aQute.bnd.component; |
| 2 | |
| 3 | import aQute.bnd.service.*; |
| 4 | import aQute.lib.osgi.*; |
| 5 | |
| 6 | /** |
| 7 | * Analyze the class space for any classes that have an OSGi annotation for DS. |
| 8 | * |
| 9 | */ |
| 10 | public class DSAnnotations implements AnalyzerPlugin { |
| 11 | |
| 12 | public boolean analyzeJar(Analyzer analyzer) throws Exception { |
| 13 | |
| 14 | for (Clazz c : analyzer.getClassspace().values()) { |
| 15 | ComponentDef definition = AnnotationReader.getDefinition(c, analyzer); |
| 16 | if (definition != null) { |
| 17 | definition.prepare(analyzer); |
| 18 | analyzer.getJar().putResource("OSGI-INF/" + definition.name + ".xml", |
| 19 | new TagResource(definition.getTag())); |
| 20 | } |
| 21 | } |
| 22 | return false; |
| 23 | } |
| 24 | |
| 25 | } |