/** * Pushes a Source onto the input stack. * * @see #getSource() * @see #pop_source() */ protected void push_source(Source source, boolean autopop) { source.init(this); source.setParent(this.source, autopop); // source.setListener(listener); if (listener != null) listener.handleSourceChange(this.source, "suspend"); this.source = source; if (listener != null) listener.handleSourceChange(this.source, "push"); }
/** * Pushes a Source onto the input stack. * * @see #getSource() * @see #pop_source() */ protected void push_source(Source source, boolean autopop) { source.init(this); source.setParent(this.source, autopop); // source.setListener(listener); if (listener != null) listener.handleSourceChange(this.source, "suspend"); this.source = source; if (listener != null) listener.handleSourceChange(this.source, "push"); }
/** * Pops a Source from the input stack. * * @see #getSource() * @see #push_source(Source,boolean) */ protected void pop_source() throws IOException { if (listener != null) listener.handleSourceChange(this.source, "pop"); Source s = this.source; this.source = s.getParent(); /* Always a noop unless called externally. */ s.close(); if (listener != null && this.source != null) listener.handleSourceChange(this.source, "resume"); }
/** * Pops a Source from the input stack. * * @see #getSource() * @see #push_source(Source,boolean) */ protected void pop_source() throws IOException { if (listener != null) listener.handleSourceChange(this.source, "pop"); Source s = this.source; this.source = s.getParent(); /* Always a noop unless called externally. */ s.close(); if (listener != null && this.source != null) listener.handleSourceChange(this.source, "resume"); }
/** * Pushes a Source onto the input stack. * * @param source the new Source to push onto the top of the input stack. * @param autopop if true, the Source is automatically removed from the input stack at EOF. * @see #getSource() * @see #pop_source() */ protected void push_source(@Nonnull Source source, boolean autopop) { source.init(this); source.setParent(this.source, autopop); // source.setListener(listener); if (listener != null) listener.handleSourceChange(this.source, SourceChangeEvent.SUSPEND); this.source = source; if (listener != null) listener.handleSourceChange(this.source, SourceChangeEvent.PUSH); }
throws IOException { if (listener != null) listener.handleSourceChange(this.source, SourceChangeEvent.POP); Source s = this.source; this.source = s.getParent(); listener.handleSourceChange(this.source, SourceChangeEvent.RESUME);