Exemplo n.º 1
0
 private void doOCD(ObjectClassDefinition o, Annotation annotation) {
   if (topLevel) {
     if (clazz.isInterface()) {
       if (ocd == null) ocd = new OCDDef(finder);
       ocd.id = o.id() == null ? name.getFQN() : o.id();
       ocd.name = o.name() == null ? space(ocd.id) : o.name();
       ocd.description = o.description() == null ? "" : o.description();
       ocd.localization =
           o.localization() == null ? "OSGI-INF/l10n/" + name.getFQN() : o.localization();
       if (annotation.get("pid") != null) {
         String[] pids = o.pid();
         designates(pids, false);
       }
       if (annotation.get("factoryPid") != null) {
         String[] pids = o.factoryPid();
         designates(pids, true);
       }
       if (annotation.get("icon") != null) {
         Icon[] icons = o.icon();
         for (Icon icon : icons) {
           ocd.icons.add(new IconDef(icon.resource(), icon.size()));
         }
       }
     } else {
       analyzer.error(
           "ObjectClassDefinition applied to non-interface, non-annotation class %s", clazz);
     }
   }
 }
Exemplo n.º 2
0
 private void doXmlAttribute(Annotation annotation, XMLAttribute xmlAttr) {
   if (current == null) {
     if (clazz.isInterface()) {
       if (ocd == null) ocd = new OCDDef(finder);
       ocd.addExtensionAttribute(xmlAttr, annotation);
     }
   } else {
     current.addExtensionAttribute(xmlAttr, annotation);
   }
 }