@Test public void testSpace() { String name = "map< string, " + "\t\r\n int>"; TypeInfo typeInfo = TypeInfoParser.getTypeInfoFromTypeString(name); Assert.assertTrue(typeInfo instanceof MapTypeInfo); Assert.assertEquals(TypeInfoFactory.STRING, ((MapTypeInfo)typeInfo).getKeyTypeInfo()); Assert.assertEquals(TypeInfoFactory.INT, ((MapTypeInfo)typeInfo).getValueTypeInfo()); Assert.assertEquals(typeInfo.getTypeName(), "MAP<STRING,INT>"); name = "struct< a : int , un : char(10)>"; typeInfo = TypeInfoParser.getTypeInfoFromTypeString(name); Assert.assertTrue(typeInfo instanceof StructTypeInfo); Assert.assertEquals(typeInfo.getTypeName(), "STRUCT<a:INT,un:CHAR(10)>"); name = "struct< a b : int, un xs: char(20)>"; typeInfo = TypeInfoParser.getTypeInfoFromTypeString(name); Assert.assertTrue(typeInfo instanceof StructTypeInfo); Assert.assertEquals(typeInfo.getTypeName(), "STRUCT<a b:INT,un xs:CHAR(20)>"); Assert.assertEquals(((StructTypeInfo)typeInfo).getFieldNames().get(0), "a b"); }
public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); static TypeInfo getTypeInfoFromTypeString(String name); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); static TypeInfo getTypeInfoFromTypeString(String name);  }