示例#1
0
 public Set<String> getTriggeringEventClassNames() {
   Set<String> triggeringEventClassNames = new HashSet<>();
   for (String className : classNames) {
     triggeringEventClassNames.add(className);
   }
   for (ViewArray viewArray : arrayFields.values()) {
     triggeringEventClassNames.addAll(viewArray.getTriggeringEventClassNames());
   }
   for (ViewObject viewObject : refFields.values()) {
     triggeringEventClassNames.addAll(viewObject.getTriggeringEventClassNames());
   }
   for (ViewArray viewArray : backRefFields.values()) {
     triggeringEventClassNames.addAll(viewArray.getTriggeringEventClassNames());
   }
   for (ViewObject viewObject : latestBackRefFields.values()) {
     triggeringEventClassNames.addAll(viewObject.getTriggeringEventClassNames());
   }
   return triggeringEventClassNames;
 }
示例#2
0
    private ViewArray processArrayNode(ArrayNode arrayNode) {
      ViewArray node = new ViewArray();

      if (arrayNode.size() != 1) {
        throw new IllegalArgumentException(
            "Arrays in example view data need to contain one and only one element");
      }

      JsonNode element = arrayNode.get(0);
      if (element == null || element.isNull()) {
        throw new IllegalArgumentException(
            "Arrays in example view data cannot contain null elements");
      }

      if (element.isArray()) {
        throw new IllegalArgumentException(
            "Arrays in example view data cannot be directly nested within other arrays.");
      } else if (element.isObject()) {
        node.element = processObjectNode((ObjectNode) element);
      }

      return node;
    }