private void checkMapReturnType(boolean hasMapReturnType) { if (hasMapReturnType) { if (!felixExtensions) { analyzer.error( "In component %s, to use a return type of Map you must specify -ds-felix-extensions", component.implementation, ""); } //TODO rethink how this is signalled. if (component.xmlns == null) { component.xmlns = FELIX_1_2; } } }
private void checkMapReturnType(boolean hasMapReturnType) { if (hasMapReturnType) { if (!felixExtensions) { analyzer.error( "In component %s, to use a return type of Map you must specify -ds-felix-extensions", component.implementation, ""); } //TODO rethink how this is signalled. if (component.xmlns == null) { component.xmlns = FELIX_1_2; } } }
private void checkMapReturnType(DeclarativeServicesAnnotationError details) { if (!options.contains(Options.felixExtensions)) { analyzer.error( "In component %s, to use a return type of Map you must specify the -dsannotations-options felixExtensions flag " + " and use a felix extension attribute or explicitly specify the appropriate xmlns.", className) .details(details); } }
private void checkMapReturnType(DeclarativeServicesAnnotationError details) { if (!options.contains(Options.felixExtensions)) { analyzer.error( "In component %s, to use a return type of Map you must specify the -dsannotations-options felixExtensions flag " + " and use a felix extension attribute or explicitly specify the appropriate xmlns.", className) .details(details); } }
void prepare(Analyzer analyzer) { if (attributes.isEmpty()) { updateVersion(MetatypeVersion.VERSION_1_3); } Set<String> adIds = new HashSet<>(); for (ADDef ad : attributes) { ad.prepare(this); if (!adIds.add(ad.id)) { analyzer.error("OCD for %s.%s has duplicate AD id %s due to colliding munged element names", id, name, ad.id); } } }
void prepare(Analyzer analyzer) { if (attributes.isEmpty()) { updateVersion(MetatypeVersion.VERSION_1_3); } Set<String> adIds = new HashSet<>(); for (ADDef ad : attributes) { ad.prepare(this); if (!adIds.add(ad.id)) { analyzer.error("OCD for %s.%s has duplicate AD id %s due to colliding munged element names", id, name, ad.id); } } }
public void setClasspath(File[] classpath) throws IOException { List<Jar> list = new ArrayList<>(); for (int i = 0; i < classpath.length; i++) { if (classpath[i].exists()) { Jar current = new Jar(classpath[i]); list.add(current); } else { error("Missing file on classpath: %s", IO.absolutePath(classpath[i])); } } for (Iterator<Jar> i = list.iterator(); i.hasNext();) { addClasspath(i.next()); } }
@Override public void annotation(Annotation annotation) throws Exception { try { java.lang.annotation.Annotation a = annotation.getAnnotation(); if (a instanceof Designate) designate = annotation; else if (a instanceof Component) pids = ((Component)a).configurationPid(); } catch (Exception e) { e.printStackTrace(); analyzer.error("During generation of a component on class %s, exception %s", clazz, e); } }
@Override public void annotation(Annotation annotation) throws Exception { try { java.lang.annotation.Annotation a = annotation.getAnnotation(); if (a instanceof Designate) designate = annotation; else if (a instanceof Component) pids = ((Component)a).configurationPid(); } catch (Exception e) { e.printStackTrace(); analyzer.error("During generation of a component on class %s, exception %s", clazz, e); } }
@Override public void annotation(Annotation annotation) throws Exception { try { java.lang.annotation.Annotation a = annotation.getAnnotation(); if (a instanceof ObjectClassDefinition) doOCD((ObjectClassDefinition) a, annotation); else if (a instanceof AttributeDefinition) methods.put(method, new Pair((AttributeDefinition)a, annotation)); } catch (Exception e) { e.printStackTrace(); analyzer.error("During generation of a component on class %s, exception %s", clazz, e); } }
@Override public void annotation(Annotation annotation) throws Exception { try { java.lang.annotation.Annotation a = annotation.getAnnotation(); if (a instanceof ObjectClassDefinition) doOCD((ObjectClassDefinition) a, annotation); else if (a instanceof AttributeDefinition) methods.put(method, new Pair((AttributeDefinition)a, annotation)); } catch (Exception e) { e.printStackTrace(); analyzer.error("During generation of a component on class %s, exception %s", clazz, e); } }
/** * */ protected void doDeactivate() { if (!LIFECYCLEDESCRIPTOR.matcher(method.getDescriptor().toString()).matches()) analyzer.error( "Deactivate method for %s does not have an acceptable prototype, only Map, ComponentContext, or BundleContext is allowed. Found: %s", clazz, method.getDescriptor()); else { component.deactivate = method.getName(); } }
/** * */ protected void doActivate() { if (!LIFECYCLEDESCRIPTOR.matcher(method.getDescriptor().toString()).matches()) analyzer.error( "Activate method for %s does not have an acceptable prototype, only Map, ComponentContext, or BundleContext is allowed. Found: %s", clazz, method.getDescriptor()); else { component.activate = method.getName(); } }
/** * */ protected void doModified() { if (!LIFECYCLEDESCRIPTOR.matcher(method.getDescriptor().toString()).matches()) analyzer.error( "Modified method for %s does not have an acceptable prototype, only Map, ComponentContext, or BundleContext is allowed. Found: %s", clazz, method.getDescriptor()); else { component.modified = method.getName(); } }
public void addClasspath(Collection<?> jars) throws IOException { for (Object jar : jars) { if (jar instanceof Jar) addClasspath((Jar) jar); else if (jar instanceof File) addClasspath((File) jar); else if (jar instanceof String) addClasspath(getFile((String) jar)); else error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar); } }
public void addClasspath(Collection< ? > jars) throws IOException { for (Object jar : jars) { if (jar instanceof Jar) addClasspath((Jar) jar); else if (jar instanceof File) addClasspath((File) jar); else if (jar instanceof String) addClasspath(getFile((String) jar)); else error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar); } }
public void addClasspath(Collection< ? > jars) throws IOException { for (Object jar : jars) { if (jar instanceof Jar) addClasspath((Jar) jar); else if (jar instanceof File) addClasspath((File) jar); else if (jar instanceof String) addClasspath(getFile((String) jar)); else error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar); } }
public void addClasspath(Collection< ? > jars) throws IOException { for (Object jar : jars) { if (jar instanceof Jar) addClasspath((Jar) jar); else if (jar instanceof File) addClasspath((File) jar); else if (jar instanceof String) addClasspath(getFile((String) jar)); else error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar); } }
public void addClasspath(Collection<?> jars) throws IOException { for (Object jar : jars) { if (jar instanceof Jar) addClasspath((Jar) jar); else if (jar instanceof File) addClasspath((File) jar); else if (jar instanceof String) addClasspath(getFile((String) jar)); else error("Cannot convert to JAR to add to classpath %s. Not a File, Jar, or String", jar); } }
private void parseAndMergeInheritedMetadata(TypeRef ref, Clazz child) throws Exception { if (ref.isJava()) return; Clazz ec = reporter.findClass(ref); if (ec == null) { reporter.error("Missing inherited class for Metatype annotations: " + ref + " from " + child.getClassName()); } else { MetaTypeReader mtr = new MetaTypeReader(ec, reporter); mtr.setDesignate(designatePid, factory); mtr.finish(); for (Map.Entry<MethodDef,Meta.AD> entry : mtr.methods.entrySet()) addMethod(entry.getKey(), entry.getValue()); handleInheritedClasses(ec); } }