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