private JSONObject setFieldAttributes(String clazz, CompactFieldNode field) throws JSONException { JSONObject port = new JSONObject(); port.put("name", field.getName()); TypeGraphVertex tgv = typeGraph.getTypeGraphVertex(clazz); putFieldDescription(field, port, tgv); List<CompactAnnotationNode> annotations = field.getVisibleAnnotations(); CompactAnnotationNode firstAnnotation; if (annotations != null && !annotations.isEmpty() && (firstAnnotation = field.getVisibleAnnotations().get(0)) != null) { for (Map.Entry<String, Object> entry : firstAnnotation.getAnnotations().entrySet()) { port.put(entry.getKey(), entry.getValue()); } } return port; }
public OperatorDiscoverer(String[] jars) { URL[] urls = new URL[jars.length]; for (int i = 0; i < jars.length; i++) { pathsToScan.add(jars[i]); try { urls[i] = new URL("file://" + jars[i]); } catch (MalformedURLException ex) { throw new RuntimeException(ex); } } classLoader = new URLClassLoader(urls, ClassLoader.getSystemClassLoader()); }