public Map<PropertyPath, Object> getMap() { serialize(ROOT, root); QueueItem<PropertyPath, Object> currentItem; while ((currentItem = queue.pollFirst()) != null) { PropertyPath path = currentItem.key; Object value = currentItem.value; if (!properties.containsKey(path)) { if (value == null) { put(path, null); } else { Schema<ValueType> schema = getSchema(path); ValueType valueType = schema.getValue(); if (schema.hasChildren() // Composite (not scalar)? && !valueType .isReference()) { // Not a reference - multiple references to same object are // allowed checkIllegalReference(path, value); } valueType.serialize(path, currentItem.value, this); } } } return unmodifiableMap(properties); }
private Schema<ValueType> getSchema(PropertyPath path) { return schemaRoot.get(path); }
public boolean isMappedPath(PropertyPath path) { return schemaRoot.find(path) != null; }