@Test public void testInvalidArr() throws Exception { EntityMetadata md = new EntityMetadata("test"); md.getFields().addNew(new ArrayField("x", new SimpleArrayElement(IntegerType.TYPE))); md.getFields().addNew(new SimpleField("x#", StringType.TYPE)); try { PredefinedFields.ensurePredefinedFields(md); Assert.fail(); } catch (Exception e) { } }
public static void ensurePredefinedFields(EntityMetadata md) { ensureObjectType(md); List<ParentNewChild> l = new ArrayList<>(); FieldCursor cursor = md.getFieldCursor(); while (cursor.next()) { FieldTreeNode f = cursor.getCurrentNode(); if (f instanceof ArrayField) { ParentNewChild x = ensureArraySize(md, (ArrayField) f); if (x != null) { l.add(x); } } } for (ParentNewChild x : l) { x.parent.addNew(x.newChild); } }
PredefinedFields { public static void ensurePredefinedFields(EntityMetadata md) { ensureObjectType(md); List<ParentNewChild> l = new ArrayList<>(); FieldCursor cursor = md.getFieldCursor(); while (cursor.next()) { FieldTreeNode f = cursor.getCurrentNode(); if (f instanceof ArrayField) { ParentNewChild x = ensureArraySize(md, (ArrayField) f); if (x != null) { l.add(x); } } } for (ParentNewChild x : l) { x.parent.addNew(x.newChild); } } }
PredefinedFields { public static void ensurePredefinedFields(EntityMetadata md) { ensureObjectType(md); List<ParentNewChild> l = new ArrayList<>(); FieldCursor cursor = md.getFieldCursor(); while (cursor.next()) { FieldTreeNode f = cursor.getCurrentNode(); if (f instanceof ArrayField) { ParentNewChild x = ensureArraySize(md, (ArrayField) f); if (x != null) { l.add(x); } } } for (ParentNewChild x : l) { x.parent.addNew(x.newChild); } } private  PredefinedFields(); }
PredefinedFields { public static void ensurePredefinedFields(EntityMetadata md) { ensureObjectType(md); List<ParentNewChild> l = new ArrayList<>(); FieldCursor cursor = md.getFieldCursor(); while (cursor.next()) { FieldTreeNode f = cursor.getCurrentNode(); if (f instanceof ArrayField) { ParentNewChild x = ensureArraySize(md, (ArrayField) f); if (x != null) { l.add(x); } } } for (ParentNewChild x : l) { x.parent.addNew(x.newChild); } } private  PredefinedFields(); static void ensurePredefinedFields(EntityMetadata md); static void updateArraySizes(EntityMetadata md, JsonNodeFactory factory, JsonDoc doc); static boolean isFieldObjectType(String fieldName); static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields); static boolean isPredefinedField(String fieldName, Fields fields); static String createArrayFieldNameFromCountField(String countField); static String createArrayCountFieldName(String arrayFieldName); }
PredefinedFields { public static void ensurePredefinedFields(EntityMetadata md) { ensureObjectType(md); List<ParentNewChild> l = new ArrayList<>(); FieldCursor cursor = md.getFieldCursor(); while (cursor.next()) { FieldTreeNode f = cursor.getCurrentNode(); if (f instanceof ArrayField) { ParentNewChild x = ensureArraySize(md, (ArrayField) f); if (x != null) { l.add(x); } } } for (ParentNewChild x : l) { x.parent.addNew(x.newChild); } } private  PredefinedFields(); static void ensurePredefinedFields(EntityMetadata md); static void updateArraySizes(EntityMetadata md, JsonNodeFactory factory, JsonDoc doc); static boolean isFieldObjectType(String fieldName); static boolean isFieldAnArrayCount(String fieldName, Fields metadataFields); static boolean isPredefinedField(String fieldName, Fields fields); static String createArrayFieldNameFromCountField(String countField); static String createArrayCountFieldName(String arrayFieldName); static final String OBJECTTYPE_FIELD; static final String FIELD_ARRAY_COUNT_POSTFIX; static final Path OBJECTTYPE_PATH; }