示例#1
0
 private void writeDynamicData(DynamicData data) throws JsonGenerationException, IOException {
   if (data != null) {
     if (data instanceof DynamicObject) {
       DynamicObject obj = (DynamicObject) data;
       if (obj.hasChildren()) {
         writer.writeFieldName(data.getName());
         writer.writeStartObject();
         for (DynamicData child : obj.getChildren()) {
           writeDynamicData(child);
         }
         writer.writeEndObject();
       }
     } else {
       StringBuilder value = new StringBuilder();
       if (data.isHidden()) {
         value.append("hidden->");
       }
       value.append(data.getGuid());
       if (data.isPrimaryKey()) {
         value.append("*");
       }
       writer.writeStringField(data.getName(), value.toString());
     }
   }
 }
示例#2
0
 @Override
 public void onDynamicData(Map<String, Object> data) throws OseeCoreException {
   super.onDynamicData(data);
   try {
     if (!wasStarted && first != null) {
       wasStarted = true;
       writer.writeStartObject();
       writer.writeArrayFieldStart(first.getName());
     }
     writer.writeObject(data);
   } catch (IOException ex) {
     throw new OseeCoreException(ex);
   }
 }