@Test public void schemaFieldTest() throws URISyntaxException, TeslaSchemaException, NoSuchAlgorithmException, SAXException, IOException, ParserConfigurationException { Schema schema = parseSchema("src/test/resources/field.tml"); Collection<UserType> types = schema.getUserTypes(); String[] expectedFieldNameList = new String[] { "Byte", "Int16", "UInt16", "Int32", "UInt32", "Int64", "UInt64", "Boolean", "Double", "Binary", "String" }; Type[] expectedTypeList = new Type[] { Primitive.BYTE, Primitive.INT16, Primitive.UINT16, Primitive.INT32, Primitive.UINT32, Primitive.INT64, Primitive.UINT64, Primitive.BOOLEAN, Primitive.DOUBLE, Primitive.BINARY, Primitive.STRING }; assert (expectedFieldNameList.length == expectedTypeList.length); assertTrue(types.iterator().next().isClass()); Class class1 = (Class) types.iterator().next(); for (int i = 0; i < expectedFieldNameList.length; i++) { String fieldName = expectedFieldNameList[i] + "Field"; Field field = class1.findField(fieldName); assertNotNull(field); assertEquals(fieldName, field.getName()); assertEquals(expectedTypeList[i], field.getType()); } }
public Collection<UserType> getUserTypes() { Collection<UserType> uts = new ArrayList<UserType>(); for (Type t : typeMap.values()) { if (t.isUserType()) { uts.add((UserType) t); } } return uts; }
Schema { public Collection<UserType> getUserTypes() { Collection<UserType> uts = new ArrayList<UserType>(); for (Type t : typeMap.values()) { if (t.isUserType()) { uts.add((UserType) t); } } return uts; } }
Schema { public Collection<UserType> getUserTypes() { Collection<UserType> uts = new ArrayList<UserType>(); for (Type t : typeMap.values()) { if (t.isUserType()) { uts.add((UserType) t); } } return uts; }  }
Schema { public Collection<UserType> getUserTypes() { Collection<UserType> uts = new ArrayList<UserType>(); for (Type t : typeMap.values()) { if (t.isUserType()) { uts.add((UserType) t); } } return uts; }  static Schema build(String path); void save(OutputStream os); Collection<Type> getTypes(); Collection<UserType> getUserTypes(); Type findType(String idOrName); SchemaVersion getVersion(); Collection<Type> getDerivedTypes(String baseTypeId,
			boolean directOnly); Collection<Type> getDerivedTypes(Type baseType,
			boolean directOnly); }
Schema { public Collection<UserType> getUserTypes() { Collection<UserType> uts = new ArrayList<UserType>(); for (Type t : typeMap.values()) { if (t.isUserType()) { uts.add((UserType) t); } } return uts; }  static Schema build(String path); void save(OutputStream os); Collection<Type> getTypes(); Collection<UserType> getUserTypes(); Type findType(String idOrName); SchemaVersion getVersion(); Collection<Type> getDerivedTypes(String baseTypeId,
			boolean directOnly); Collection<Type> getDerivedTypes(Type baseType,
			boolean directOnly); static final String TYPE_ID_TOKENIZER_PATTERN; }