public Map<String, String> getDefaults(Annotation a) { TypeRef name = a.getName(); Map<String, String> defaults = defaultsCache.get(name); if (defaults == null) defaults = extractDefaults(name, analyzer); if (defaults == null) return new LinkedHashMap<>(); return new LinkedHashMap<>(defaults); }
public Map<String, String> getDefaults(Annotation a) { TypeRef name = a.getName(); Map<String, String> defaults = defaultsCache.get(name); if (defaults == null) defaults = extractDefaults(name, analyzer); if (defaults == null) return new LinkedHashMap<>(); return new LinkedHashMap<>(defaults); }
/** * Check if a dependency is already declared in another same bindMethod (or class field) on another child class. */ private void checkDependencyAlreadyDeclaredInChild(Annotation annotation, String methodOrField, boolean method) { if (! m_baseClass && m_bindMethods.contains(methodOrField + "/" + m_descriptor)) { throw new IllegalStateException("Annotation " + annotation.getName().getShortName() + " declared on " + m_currentClassName + "." + methodOrField + (method ? " method" : " field") + " is already declared in child classe(s)"); } m_bindMethods.add(methodOrField + "/" + m_descriptor); }
public synchronized XMLAttribute getXMLAttribute(Annotation a) throws Exception { TypeRef name = a.getName(); if (annoCache.containsKey(name)) return annoCache.get(name); Clazz clazz = analyzer.findClass(name); if (clazz != null) { xmlAttr = null; clazz.parseClassFileWithCollector(this); annoCache.put(name, xmlAttr); return xmlAttr; } return null; }
public synchronized XMLAttribute getXMLAttribute(Annotation a) throws Exception { TypeRef name = a.getName(); if (annoCache.containsKey(name)) return annoCache.get(name); Clazz clazz = analyzer.findClass(name); if (clazz != null) { xmlAttr = null; clazz.parseClassFileWithCollector(this); annoCache.put(name, xmlAttr); return xmlAttr; } return null; }
@Override public void annotation(Annotation annotation) { try { if (Meta.OCD.class.getName() .equals(annotation.getName() .getFQN())) { MetaTypeReader.this.ocdAnnotation = annotation; } else if (Meta.AD.class.getName() .equals(annotation.getName() .getFQN())) { assert method != null; methods.put(method, annotation); } } catch (Exception e) { reporter.error("Error during annotation parsing %s : %s", clazz, e); e.printStackTrace(); } }
@Override public void annotation(Annotation annotation) throws Exception { String fqn = annotation.getName() .getFQN(); if (fqn.equals("aQute.bnd.annotation.xml.XMLAttribute")) { xmlAttr = annotation.getAnnotation(XMLAttribute.class); } }
@Override public void annotation(Annotation annotation) throws Exception { String fqn = annotation.getName() .getFQN(); if (fqn.equals("aQute.bnd.annotation.xml.XMLAttribute")) { xmlAttr = annotation.getAnnotation(XMLAttribute.class); } }
@Override public void annotation(Annotation annotation) throws Exception { String fqn = annotation.getName() .getFQN(); if (fqn.equals("org.osgi.service.cdi.annotations.Beans")) { Object[] beanClasses = annotation.get("value"); if (beanClasses != null && beanClasses.length > 0) { marked = new Instruction(Arrays.stream(beanClasses) .map(Object::toString) .collect(Collectors.joining(","))); } else { marked = new Instruction("*"); } } } }
void addAnnotation(Annotation a) { if (annotations == null) annotations = Create.set(); annotations.add(analyzer.getTypeRef(a.getName() .getBinary())); }
void addAnnotation(Annotation a) { if (annotations == null) annotations = Create.set(); annotations.add(analyzer.getTypeRef(a.getName().getBinary())); }
@Override public void annotation(Annotation annotation) throws Exception { String fqn = annotation.getName() .getFQN(); if (fqn.equals("org.osgi.service.cdi.annotations.Beans")) { Object[] beanClasses = annotation.get("value"); if (beanClasses != null && beanClasses.length > 0) { marked = new Instruction(Arrays.stream(beanClasses) .map(Object::toString) .collect(Collectors.joining(","))); } else { marked = new Instruction("*"); } } } }
void addAnnotation(Annotation a) { if (annotations == null) annotations = Create.set(); annotations.add(analyzer.getTypeRef(a.getName() .getBinary())); }
void addAnnotation(Annotation a) { if (annotations == null) annotations = Create.set(); annotations.add(analyzer.getTypeRef(a.getName().getBinary())); }
private Element annotatedToElement(Annotation annotation) { Collection<Element> properties = Create.set(); for (Entry<String, Object> entry : annotation.entrySet()) { addAnnotationMember(properties, entry.getKey(), entry.getValue()); } return new Element(ANNOTATED, annotation.getName() .getFQN(), properties, CHANGED, CHANGED, null); }
private Element annotatedToElement(Annotation annotation) { Collection<Element> properties = Create.set(); for (Entry<String, Object> entry : annotation.entrySet()) { addAnnotationMember(properties, entry.getKey(), entry.getValue()); } return new Element(ANNOTATED, annotation.getName() .getFQN(), properties, CHANGED, CHANGED, null); }
private void handleAttributeOrDirective(Annotation a) { Object o = annotation.get(lastMethodSeen); if (o != null) { String attributeName = a.get("value"); if (attributeName == null) { attributeName = lastMethodSeen; } if (STD_DIRECTIVE.equals(a.getName() .getFQN())) { attributeName += ":"; } if (!attributesAndDirectives.containsKey(attributeName)) { attributesAndDirectives.putTyped(attributeName, o); } } }
private void handleAttributeOrDirective(Annotation a) { Object o = annotation.get(lastMethodSeen); if (o != null) { String attributeName = a.get("value"); if (attributeName == null) { attributeName = lastMethodSeen; } if (STD_DIRECTIVE.equals(a.getName() .getFQN())) { attributeName += ":"; } if (!attributesAndDirectives.containsKey(attributeName)) { attributesAndDirectives.putTyped(attributeName, o); } } }
private Element annotatedToElement(Annotation annotation) { Collection<Element> properties = Create.set(); for (String key : annotation.keySet()) { addAnnotationMember(properties, key, annotation.get(key)); } return new Element(Type.ANNOTATED, annotation.getName().getFQN(), properties, CHANGED, CHANGED, null); }
private Element annotatedToElement(Annotation annotation) { Collection<Element> properties = Create.set(); for (String key : annotation.keySet()) { addAnnotationMember(properties, key, annotation.get(key)); } return new Element(Type.ANNOTATED, annotation.getName().getFQN(), properties, CHANGED, CHANGED, null); }