/** * @param pw * @param provides */ void provide(PrintWriter pw, String provides, boolean servicefactory, String impl) { if (provides != null) { if (!servicefactory) pw.println(" <service>"); else pw.println(" <service servicefactory='true'>"); StringTokenizer st = new StringTokenizer(provides, ","); while (st.hasMoreTokens()) { String interfaceName = st.nextToken(); pw.println(" <provide interface='" + interfaceName + "'/>"); analyzer.referTo(interfaceName); // TODO verifies the impl. class extends or implements the // interface } pw.println(" </service>"); } else if (servicefactory) warning("The servicefactory:=true directive is set but no service is provided, ignoring it"); }
pw.print("'"); } else { warning("Invalid property type '" + type + "' for property " + name);
warning("For a Service Component, the immediate option and the servicefactory option are mutually exclusive for %(%s)", name, impl);
private void reportInvalidUseOfServiceComponentHeader(String name) throws Exception, IOException { SetLocation warning = warning(Constants.SERVICE_COMPONENT + " is normally generated by bnd. If you want to point at specific component XML files (wildcards are allowed, see findEntries) make sure it ends in '.xml'. Found %s", name);
private void reportInvalidUseOfServiceComponentHeader(String name) throws Exception, IOException { SetLocation warning = warning(Constants.SERVICE_COMPONENT + " is normally generated by bnd. If you want to point at specific component XML files (wildcards are allowed, see findEntries) make sure it ends in '.xml'. Found %s", name);
/** * Check if annotations are actually feasible looking at the class * format. If the class format does not provide annotations then it is * no use specifying annotated components. * * @param name * @return * @throws Exception */ private Collection<Clazz> checkAnnotationsFeasible(String name) throws Exception { Collection<Clazz> not = analyzer.getClasses("", QUERY.NAMED.toString(), name // ); if (not.isEmpty()) { if ("*".equals(name)) return not; error("Specified %s but could not find any class matching this pattern", name); } for (Clazz c : not) { if (c.getFormat().hasAnnotations()) return not; } warning("Wildcards are used (%s) requiring annotations to decide what is a component. Wildcard maps to classes that are compiled with java.target < 1.5. Annotations were introduced in Java 1.5", name); return not; }
/** * Check if annotations are actually feasible looking at the class * format. If the class format does not provide annotations then it is * no use specifying annotated components. * * @param name * @return * @throws Exception */ private Collection<Clazz> checkAnnotationsFeasible(String name) throws Exception { Collection<Clazz> not = analyzer.getClasses("", QUERY.NAMED.toString(), name // ); if (not.isEmpty()) if ( "*".equals(name)) return not; else error("Specified %s but could not find any class matching this pattern", name); for (Clazz c : not) { if (c.getFormat().hasAnnotations()) return not; } warning("Wildcards are used (%s) requiring annotations to decide what is a component. Wildcard maps to classes that are compiled with java.target < 1.5. Annotations were introduced in Java 1.5", name); return not; }
/** * Check if annotations are actually feasible looking at the class * format. If the class format does not provide annotations then it is * no use specifying annotated components. * * @param name * @return * @throws Exception */ private Collection<Clazz> checkAnnotationsFeasible(String name) throws Exception { Collection<Clazz> not = analyzer.getClasses("", QUERY.NAMED.toString(), name // ); if (not.isEmpty()) { if ("*".equals(name)) return not; error("Specified %s but could not find any class matching this pattern", name); } for (Clazz c : not) { if (c.getFormat().hasAnnotations()) return not; } warning("Wildcards are used (%s) requiring annotations to decide what is a component. Wildcard maps to classes that are compiled with java.target < 1.5. Annotations were introduced in Java 1.5", name); return not; }
/** * Check if annotations are actually feasible looking at the class * format. If the class format does not provide annotations then it is * no use specifying annotated components. * * @param name * @return * @throws Exception */ private Collection<Clazz> checkAnnotationsFeasible(String name) throws Exception { Collection<Clazz> not = analyzer.getClasses("", QUERY.NAMED.toString(), name // ); if (not.isEmpty()) { if ("*".equals(name)) return not; error("Specified %s but could not find any class matching this pattern", name); } for (Clazz c : not) { if (c.getFormat().hasAnnotations()) return not; } warning("Wildcards are used (%s) requiring annotations to decide what is a component. Wildcard maps to classes that are compiled with java.target < 1.5. Annotations were introduced in Java 1.5", name); return not; }