public ObjectNode toJson() {
ObjectMapper om = new ObjectMapper();
ObjectNode root = om.createObjectNode();
root.put(JSON_ID, getIdentifier());
root.put(JSON_IS_MULTIPLE, isMultiple());
root.put(JSON_COMP_REF_NAME, getComponent().getName());
root.put(JSON_PROVIDER_URL, providerURL);
ObjectNode json_rr = om.createObjectNode();
json_rr.put(JSON_RESOLVABLE_REF_NAME, getTarget().getName());
// Set RRTYPE
if (getTarget() instanceof InterfaceReference) {
json_rr.put(JSON_RESOLVABLE_REF_TYPE, RRTYPE.itf.toString());
} else if (getTarget() instanceof MessageReference) {
json_rr.put(JSON_RESOLVABLE_REF_TYPE, RRTYPE.message.toString());
} else if (getTarget() instanceof InstanceReference) {
json_rr.put(JSON_RESOLVABLE_REF_TYPE, RRTYPE.instance.toString());
}
// Set the ResolvableReference
root.put(JSON_RESOLVABLE_REF, json_rr);