int n = clause.indexOf('='); if (n <= 0) { error("Not a valid property in service component: " + clause); } else { String type = null;
private void doAttribute(PrintWriter pw, String value, String name, String... matches) { if (value != null) { if (matches.length != 0) { if (matches.length == 1 && matches[0].equals(JIDENTIFIER)) { if (!Verifier.isIdentifier(value)) error("Component attribute %s has value %s but is not a Java identifier", name, value); } else { if (!Verifier.isMember(value, matches)) error("Component attribute %s has value %s but is not a member of %s", name, value, Arrays.toString(matches)); } } pw.print(" "); pw.print(name); pw.print("='"); pw.print(value); pw.print("'"); } }
/** * Check if we need to use the v1.1 namespace (or later). * * @param info * @return */ private String getNamespace(Map<String, String> info) { String version = info.get(COMPONENT_VERSION); if (version != null) { try { Version v = new Version(version); return NAMESPACE_STEM + "/v" + v; } catch (Exception e) { error("version: specified on component header but not a valid version: " + version); return null; } } for (String key : info.keySet()) { if (SET_COMPONENT_DIRECTIVES_1_1.contains(key)) { return NAMESPACE_STEM + "/v1.1.0"; } } return null; }
if (referenceName.endsWith(":")) { if (!SET_COMPONENT_DIRECTIVES.contains(referenceName)) error("Unrecognized directive in Service-Component header: " + referenceName); continue; error("Invalid Interface Name for references in Service Component: " + referenceName + "=" + interfaceName); continue; error("The bind method %s for %s not defined", bind, referenceName); error("The unbind method %s for %s not defined", unbind, referenceName);
createComponentResource(serviceComponents, name, info); else error("Set to %s but entry %s is not an FQN ", NOANNOTATIONS, name);
createComponentResource(serviceComponents, name, info); else error("Set to %s but entry %s is not an FQN ", NOANNOTATIONS, name);
createComponentResource(serviceComponents, name, info); else error("Set to %s but entry %s is not an FQN ", NOANNOTATIONS, name);
createComponentResource(serviceComponents, name, info); else error("Set to %s but entry %s is not an FQN ", NOANNOTATIONS, name);
SetLocation loc = error(Constants.SERVICE_COMPONENT + " refers to %s that is annotated with the deprecated bnd Component annotation. Support for this was removed in 4.0.0 because they were taken over by OSGi. Please update to the comparable OSGi annotations", clazz.getFQN());
error("Invalid " + Constants.SERVICE_COMPONENT + " header: %s %s, throws %s", name, info, e); throw e;
SetLocation loc = error(Constants.SERVICE_COMPONENT + " refers to %s that is annotated with the deprecated bnd Component annotation. Support for this was removed in 4.0.0 because they were taken over by OSGi. Please update to the comparable OSGi annotations", clazz.getFQN());
error("Invalid " + Constants.SERVICE_COMPONENT + " header: %s %s, throws %s", name, info, e); throw e;
error("Invalid " + Constants.SERVICE_COMPONENT + " header: %s %s, throws %s", name, info, e); throw e;
error("Invalid Service-Component header: %s %s, throws %s", name, info, e);
error("Invalid Service-Component header: %s %s, throws %s", name, info, e); throw e;
error("Invalid " + Constants.SERVICE_COMPONENT + " header: %s %s, throws %s", name, info, e); throw e;
/** * 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; }
/** * 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; }