@Test public void testSubtype() { IntegerParameterType.Builder itb = new IntegerParameterType.Builder(); AggregateParameterType.Builder aggType = new AggregateParameterType.Builder(); Member m1 = new Member("m1"); IntegerParameterType intType = itb.build(); m1.setDataType(intType); aggType.addMember(m1); ArrayParameterType.Builder arrayType = new ArrayParameterType.Builder().setNumberOfDimensions(1); arrayType.setElementType(aggType.build()); PathElement[] path = AggregateUtil.parseReference("[2].m1"); DataType dt = DataTypeUtil.getMemberType(arrayType.build(), path); assertEquals(intType, dt); }
public static PathElement[] parseReference(String name) { List<PathElement> tmp = new ArrayList<>(); for (String ps : Splitter.on('.').omitEmptyStrings().split(name)) { tmp.add(PathElement.fromString(ps)); } return tmp.toArray(new PathElement[0]); }
AggregateUtil { public static PathElement[] parseReference(String name) { List<PathElement> tmp = new ArrayList<>(); for (String ps : Splitter.on('.').omitEmptyStrings().split(name)) { tmp.add(PathElement.fromString(ps)); } return tmp.toArray(new PathElement[0]); } }
AggregateUtil { public static PathElement[] parseReference(String name) { List<PathElement> tmp = new ArrayList<>(); for (String ps : Splitter.on('.').omitEmptyStrings().split(name)) { tmp.add(PathElement.fromString(ps)); } return tmp.toArray(new PathElement[0]); }  }
AggregateUtil { public static PathElement[] parseReference(String name) { List<PathElement> tmp = new ArrayList<>(); for (String ps : Splitter.on('.').omitEmptyStrings().split(name)) { tmp.add(PathElement.fromString(ps)); } return tmp.toArray(new PathElement[0]); }  static int findSeparator(String s); static PathElement[] parseReference(String name); static boolean verifyPath(ParameterType parameterType, PathElement[] path); static PartialParameterValue extractMember(ParameterValue pv, PathElement[] path); static void updateMember(ParameterValue pv, PartialParameterValue patch); static Value getMemberValue(Value value, PathElement[] path); static String toString(PathElement[] path); static AggregateParameterType createParameterType(String name, AggregateValue v); }
AggregateUtil { public static PathElement[] parseReference(String name) { List<PathElement> tmp = new ArrayList<>(); for (String ps : Splitter.on('.').omitEmptyStrings().split(name)) { tmp.add(PathElement.fromString(ps)); } return tmp.toArray(new PathElement[0]); }  static int findSeparator(String s); static PathElement[] parseReference(String name); static boolean verifyPath(ParameterType parameterType, PathElement[] path); static PartialParameterValue extractMember(ParameterValue pv, PathElement[] path); static void updateMember(ParameterValue pv, PartialParameterValue patch); static Value getMemberValue(Value value, PathElement[] path); static String toString(PathElement[] path); static AggregateParameterType createParameterType(String name, AggregateValue v);  }