T212Mapper { public Map<String,String> readMap(InputStream is) throws IOException, T212FormatException { applyConfigurator(); return _readValueAndClose(factory.parser(is),getMapGenericType().get(),Map.class); } T212Mapper(); T212Mapper enableDefaultParserFeatures(); T212Mapper enableDefaultVerifyFeatures(); T212Mapper enable(SegmentParserFeature feature); T212Mapper enable(ParserFeature feature); T212Mapper enable(VerifyFeature feature); T212Mapper disable(SegmentParserFeature feature); T212Mapper disable(ParserFeature feature); T212Mapper disable(VerifyFeature feature); T212Mapper configurator(T212Configurator configurator); ObjectMapper objectMapper(); T readValue(InputStream is, Class<T> value); T readValue(byte[] bytes, Class<T> value); T readValue(Reader reader, Class<T> value); T readValue(String data, Class<T> value); void writeValueAsStream(T value, Class<T> type, OutputStream outputStream); void writeValueAsWriter(T value, Class<T> type, Writer writer); Map<String,String> readMap(InputStream is); Map<String,String> readMap(byte[] bytes); Map<String,String> readMap(Reader reader); Map<String,String> readMap(String data); Map<String,Object> readDeepMap(InputStream is); Map<String,Object> readDeepMap(byte[] bytes); Map<String,Object> readDeepMap(Reader reader); Map<String,Object> readDeepMap(String data); Data readData(InputStream is); Data readData(byte[] bytes); Data readData(Reader reader); Data readData(String data); String writeMapAsString(Map data); char[] writeMapAsCharArray(Map data); String writeDataAsString(Data data); char[] writeDataAsCharArray(Data data);  }
@Test public void readMap() { String h212 = "##0139ST=32;CN=2011;PW=123456;MN=LD130133000015;CP=&&DataTime=20160824003817000;B01-Rtd=36.91;011-Rtd=231.0,011-Flag=N;060-Rtd=1.803,060-Flag=N&&4980\r\n"; T212Mapper mapper = new T212Mapper() .enableDefaultParserFeatures() .enableDefaultVerifyFeatures(); try { Map<String,String> data = mapper.readMap(h212); assertEquals(data.get("ST"),"32"); assertEquals(data.get("CN"),"2011"); assertEquals(data.get("PW"),"123456"); assertEquals(data.get("MN"),"LD130133000015"); assertEquals(data.get("CP"),"DataTime=20160824003817000;B01-Rtd=36.91;011-Rtd=231.0,011-Flag=N;060-Rtd=1.803,060-Flag=N"); } catch (Exception e) { e.printStackTrace(); assert false; } }