Search in sources :

Example 1 with CompactAnnotationNode

use of com.datatorrent.stram.webapp.asm.CompactAnnotationNode in project apex-core by apache.

the class OperatorDiscoverer method setFieldAttributes.

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;
}
Also used : JSONObject(org.codehaus.jettison.json.JSONObject) TypeGraphVertex(com.datatorrent.stram.webapp.TypeGraph.TypeGraphVertex) JSONObject(org.codehaus.jettison.json.JSONObject) CompactAnnotationNode(com.datatorrent.stram.webapp.asm.CompactAnnotationNode) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

TypeGraphVertex (com.datatorrent.stram.webapp.TypeGraph.TypeGraphVertex)1 CompactAnnotationNode (com.datatorrent.stram.webapp.asm.CompactAnnotationNode)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 JSONObject (org.codehaus.jettison.json.JSONObject)1