Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 private Schema<ValueType> getSchema(PropertyPath path) {
   return schemaRoot.get(path);
 }
Exemplo n.º 3
0
 public boolean isMappedPath(PropertyPath path) {
   return schemaRoot.find(path) != null;
 }