@Test public void testWithNameTypeAndInvalidData() { try (NameSampleDataStream sampleStream = new NameSampleDataStream( ObjectStreamUtils.createObjectStream("<START:> Name <END>"))) { sampleStream.read(); fail(); } catch (IOException expected) { } try (NameSampleDataStream sampleStream = new NameSampleDataStream( ObjectStreamUtils.createObjectStream( "<START:street> <START:person> Name <END> <END>"))) { sampleStream.read(); fail(); } catch (IOException expected) { } }
public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } }
NameSampleDataStream extends FilterObjectStream<String, NameSample> { public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } } }
NameSampleDataStream extends FilterObjectStream<String, NameSample> { public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } } NameSampleDataStream(ObjectStream<String> in); }
NameSampleDataStream extends FilterObjectStream<String, NameSample> { public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } } NameSampleDataStream(ObjectStream<String> in); NameSample read(); }
NameSampleDataStream extends FilterObjectStream<String, NameSample> { public NameSample read() throws IOException { String token = samples.read(); boolean isClearAdaptiveData = false; while (token != null && token.trim().length() == 0) { isClearAdaptiveData = true; token = samples.read(); } if (token != null) { return NameSample.parse(token, isClearAdaptiveData); } else { return null; } } NameSampleDataStream(ObjectStream<String> in); NameSample read(); static final String START_TAG_PREFIX; static final String START_TAG; static final String END_TAG; }