/** * Register the given object tree under the given reference, and select a name * for a local copy of that object if it ends up in the constructed spec. */ public LocalContent register(Reference ref, JsonNode node) { if (!localContentItems.containsKey(ref)) { register(new LocalContent(ref, node)); } return localContentItems.get(ref); }
public JsonNode getLocalizedRefNode(Reference ref) { Optional<JsonNode> node = getModelObject(ref); if (node.isPresent()) { localizer.register(ref, node.get()); return localizer.getLocalizedRefNode(ref); } else { return ref.getBadRefNode(); } }
public Reference getLocalizedRef(Reference ref) { Optional<JsonNode> node = getModelObject(ref); if (node.isPresent()) { localizer.register(ref, node.get()); return localizer.getLocalizedRef(ref); } else { return ref.getBadRef(); } }
public void localizeObjectsInSection(Content content, ObjectType section) { for (String objectName : content.getObjectNames(section)) { Reference ref = content.getObjectReference(section, objectName); JsonNode obj = content.getObject(section, objectName).get(); localizer.register(ref, obj); } }
private void retainObjectsInSection(Content content, ObjectType section) { for (String objectName : content.getObjectNames(section)) { Reference ref = content.getObjectReference(section, objectName); JsonNode obj = content.getObject(section, objectName).get(); localizer.register(ref, obj).retain(); } }