/** * {@inheritDoc} */ public boolean hasNext() { return myWrapped.hasNext(); }
/** * Constructor * * @param theReader * The reader to read from * @param theHapiContext * The HapiContext from which to obtain the parser */ public Hl7InputStreamMessageIterator(Reader theReader, HapiContext theHapiContext) { super(theHapiContext); myWrapped = new Hl7InputStreamMessageStringIterator(theReader); }
/** * If set to true, any lines beginning with a hash (#) will be ignored. This allows * you to place comments in a file to be read if needed. */ public void setIgnoreComments(boolean theIgnoreComments) { myWrapped.setIgnoreComments(theIgnoreComments); }
is = new FileInputStream(file); is = new BufferedInputStream(is); Hl7InputStreamMessageStringIterator iter2 = new Hl7InputStreamMessageStringIterator(is); while (iter2.hasNext()) { String next = iter2.next();
/** * {@inheritDoc} */ public Message next() { String nextString = myWrapped.next(); Message retVal; try { if (myMessageType != null) { retVal = ReflectionUtil.instantiateMessage(myMessageType, getHapiContext().getModelClassFactory()); retVal.parse(nextString); } else { retVal = getHapiContext().getPipeParser().parse(nextString); } } catch (EncodingNotSupportedException e) { throw new Hl7InputStreamMessageStringIterator.ParseFailureError("Failed to parse message", e); } catch (HL7Exception e) { throw new Hl7InputStreamMessageStringIterator.ParseFailureError("Failed to parse message", e); } return retVal; }
/** * {@inheritDoc} */ public Message next() { String nextString = myWrapped.next(); Message retVal; try { if (myMessageType != null) { retVal = ReflectionUtil.instantiateMessage(myMessageType, getHapiContext().getModelClassFactory()); retVal.parse(nextString); } else { retVal = getHapiContext().getPipeParser().parse(nextString); } } catch (EncodingNotSupportedException e) { throw new Hl7InputStreamMessageStringIterator.ParseFailureError("Failed to parse message", e); } catch (HL7Exception e) { throw new Hl7InputStreamMessageStringIterator.ParseFailureError("Failed to parse message", e); } return retVal; }
/** * {@inheritDoc} */ public boolean hasNext() { return myWrapped.hasNext(); }
/** * Constructor * * @param theInputStream * The input stream to read from * @param theHapiContext * The HapiContext from which to obtain the parser */ public Hl7InputStreamMessageIterator(InputStream theInputStream, HapiContext theHapiContext) { super(theHapiContext); myWrapped = new Hl7InputStreamMessageStringIterator(theInputStream); }
/** * If set to true, any lines beginning with a hash (#) will be ignored. This allows * you to place comments in a file to be read if needed. */ public void setIgnoreComments(boolean theIgnoreComments) { myWrapped.setIgnoreComments(theIgnoreComments); }
/** * {@inheritDoc} */ public String next() { if (!hasNext()) { throw new IllegalStateException(); } String retVal = myNext; myNext = null; myHasNext = null; return retVal; }
/** * Constructor * * @param theReader * The reader to read from * @param theHapiContext * The HapiContext from which to obtain the parser */ public Hl7InputStreamMessageIterator(Reader theReader, HapiContext theHapiContext) { super(theHapiContext); myWrapped = new Hl7InputStreamMessageStringIterator(theReader); }
/** * {@inheritDoc} */ public String next() { if (!hasNext()) { throw new IllegalStateException(); } String retVal = myNext; myNext = null; myHasNext = null; return retVal; }
/** * Constructor * * @param theInputStream * The input stream to read from * @param theHapiContext * The HapiContext from which to obtain the parser */ public Hl7InputStreamMessageIterator(InputStream theInputStream, HapiContext theHapiContext) { super(theHapiContext); myWrapped = new Hl7InputStreamMessageStringIterator(theInputStream); }