Skip to content

Instantly share code, notes, and snippets.

@jconnolly
Created November 18, 2011 17:18
Show Gist options
  • Save jconnolly/1377097 to your computer and use it in GitHub Desktop.
Save jconnolly/1377097 to your computer and use it in GitHub Desktop.
iterate through methods
else {
for (Method method : JsonNode.class.getMethods()){
try {
System.out.println(method.getName()+": "+method.invoke(payloadJson, null));
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Map<String, Object> payload = mapper.readValue(payloadJson, Map.class);
((ISwarmJsonMessageListener)listener).messageRecieved(payload, swarmId, resourceId, isPublic);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment