private String toString(TypeRef[] prototype) { StringBuilder sb = new StringBuilder(); sb.append("("); String del = ""; for (TypeRef ref : prototype) { sb.append(del); sb.append(ref.getFQN()); del = ","; } sb.append(")"); return sb.toString(); }
private String toString(TypeRef[] prototype) { StringBuilder sb = new StringBuilder(); sb.append("("); String del = ""; for (TypeRef ref : prototype) { sb.append(del); sb.append(ref.getFQN()); del = ","; } sb.append(")"); return sb.toString(); }
public <T extends java.lang.annotation.Annotation> T getAnnotation() throws Exception { String cname = name.getFQN(); try { Class<T> c = (Class<T>) getClass().getClassLoader().loadClass(cname); return getAnnotation(c); } catch (ClassNotFoundException e) { } catch (NoClassDefFoundError e) { } return null; }
@Override public String toString() { if (className != null) { return className.getFQN(); } return resource.toString(); }
public <T extends java.lang.annotation.Annotation> T getAnnotation(ClassLoader cl) throws Exception { String cname = name.getFQN(); try { @SuppressWarnings("unchecked") Class<T> c = (Class<T>) cl.loadClass(cname); return getAnnotation(c); } catch (ClassNotFoundException | NoClassDefFoundError e) { return null; } }
@Override public void implementsInterfaces(TypeRef names[]) throws Exception { Arrays.sort(names); // ignore type reordering for (TypeRef name : names) { String comment = null; if (clazz.isInterface() || clazz.isAbstract()) comment = inherit(members, name); members.add(new Element(IMPLEMENTS, name.getFQN(), null, MINOR, MAJOR, comment)); } }
public int compareTo(TypeRef other) { if (this == other) return 0; return getFQN().compareTo(other.getFQN()); }
private static void method(PrintWriter out, String element, Clazz.MethodDef source, String closeElement) { out.println(" <" + element + " class='" + source.getContainingClass().getFQN() + "'" + getAccess(source.getAccess()) + (source.isConstructor() ? "" : " name='" + source.getName() + "'") + " descriptor='" + source.getDescriptor() + "' pretty='" + source.toString() + "'" + closeElement); }
String effectiveName() { if (name != null) return name; if (implementation != null) return implementation.getFQN(); return "<name not yet determined>"; }
void doComponent(Annotation a, Component c) { pids = a.containsKey("configurationPid") ? c.configurationPid() : null; if (pids != null) { pid = pids[0]; } if (pids == null || "$".equals(pid)) { pid = a.containsKey("name") ? c.name() : clazz.getClassName() .getFQN(); } }
@Override public int compareTo(TypeRef other) { if (this == other) return 0; return fqn.compareTo(other.getFQN()); }
@Override public void extendsClass(TypeRef name) throws Exception { String comment = null; if (!clazz.isInterface()) comment = inherit(members, name); Clazz c = analyzer.findClass(name); if ((c == null || c.isPublic()) && !name.isObject()) members.add(new Element(Type.EXTENDS, name.getFQN(), null, MICRO, MAJOR, comment)); }
private static void method(PrintWriter out, String element, Clazz.MethodDef source, String closeElement) { out.println(" <" + element + " class='" + source.getContainingClass() .getFQN() + "'" + getAccess(source.getAccess()) + (source.isConstructor() ? "" : " name='" + source.getName() + "'") + " descriptor='" + source.getDescriptor() + "' pretty='" + source.toString() + "'" + closeElement); }
private String valueToProperty(Object value, boolean isClass) { if (isClass) return ((TypeRef) value).getFQN(); return value.toString(); }
private DeclarativeServicesAnnotationError getDetails(ReferenceDef def, ErrorType type) { if (def == null) { return null; } if (def.bindDescriptor != null) { return new DeclarativeServicesAnnotationError(className.getFQN(), def.bind, def.bindDescriptor, type); } return new DeclarativeServicesAnnotationError(className.getFQN(), def.field, type); }
@Override public int compareTo(TypeRef other) { if (this == other) return 0; return getFQN().compareTo(other.getFQN()); }
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); }
@Override public void extendsClass(TypeRef name) throws Exception { String comment = null; if (!clazz.isInterface()) comment = inherit(members, name); Clazz c = analyzer.findClass(name); if ((c == null || c.isPublic()) && !name.isObject()) members.add(new Element(EXTENDS, name.getFQN(), null, MICRO, MAJOR, comment)); }
private String convert(Object value, boolean isClass) { if (isClass) return ((TypeRef) value).getFQN(); return String.valueOf(value); }
@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); } }