/** * Returns the input as a string. * * <p> * This always returns a value for input of type {@link CharSequence}. * <br>For other input types, use {@link BeanContext#BEAN_debug} setting to enable caching to a string * before parsing so that this method returns the input. * * @return The input as a string, or <jk>null</jk> if no pipe has been created or we're reading from an uncached reader or input stream source. */ public String getInputAsString() { return pipe == null ? null : pipe.getInputAsString(); }
/** * Returns the input as a string. * * <p> * This always returns a value for input of type {@link CharSequence}. * <br>For other input types, use {@link BeanContext#BEAN_debug} setting to enable caching to a string * before parsing so that this method returns the input. * * @return The input as a string, or <jk>null</jk> if no pipe has been created or we're reading from an uncached reader or input stream source. */ public String getInputAsString() { return pipe == null ? null : pipe.getInputAsString(); }
/** * Returns the input as a string. * * <p> * This always returns a value for input of type {@link CharSequence}. * <br>For other input types, use {@link BeanContext#BEAN_debug} setting to enable caching to a string * before parsing so that this method returns the input. * * @return The input as a string, or <jk>null</jk> if no pipe has been created or we're reading from an uncached reader or input stream source. */ public String getInputAsString() { return pipe == null ? null : pipe.getInputAsString(); }
/** * Constructor. * * @param pipe The parser input. * @param decodeChars Whether the input is URL-encoded. * @throws Exception */ public UonReader(ParserPipe pipe, boolean decodeChars) throws Exception { super(pipe); this.decodeChars = decodeChars; if (pipe.isString()) { String in = pipe.getInputAsString(); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { this.buff = new char[1024]; } }
/** * Constructor. * * @param pipe The parser input. * @param decodeChars Whether the input is URL-encoded. * @throws Exception */ public UonReader(ParserPipe pipe, boolean decodeChars) throws Exception { super(pipe); this.decodeChars = decodeChars; if (pipe.isString()) { String in = pipe.getInputAsString(); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { this.buff = new char[1024]; } }
/** * Constructor. * * @param pipe The parser input. * @param decodeChars Whether the input is URL-encoded. * @throws Exception */ public UonReader(ParserPipe pipe, boolean decodeChars) throws Exception { super(pipe); this.decodeChars = decodeChars; if (pipe.isString()) { String in = pipe.getInputAsString(); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { this.buff = new char[1024]; } }
/** * Constructor. * * @param pipe The parser input. * @throws IOException */ public ParserReader(ParserPipe pipe) throws IOException { this.unbuffered = pipe.unbuffered; if (pipe.isString()) { String in = pipe.getInputAsString(); this.r = new CharSequenceReader(in); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { Reader _r = pipe.getReader(); if (_r instanceof ParserReader) this.r = ((ParserReader)_r).r; else this.r = _r; this.buff = new char[1024]; } pipe.setPositionable(this); }
/** * Constructor. * * @param pipe The parser input. * @throws IOException */ public ParserReader(ParserPipe pipe) throws IOException { this.unbuffered = pipe.unbuffered; if (pipe.isString()) { String in = pipe.getInputAsString(); this.r = new CharSequenceReader(in); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { Reader _r = pipe.getReader(); if (_r instanceof ParserReader) this.r = ((ParserReader)_r).r; else this.r = _r; this.buff = new char[1024]; } pipe.setPositionable(this); }
/** * Constructor. * * @param pipe The parser input. * @throws IOException */ public ParserReader(ParserPipe pipe) throws IOException { this.unbuffered = pipe.unbuffered; if (pipe.isString()) { String in = pipe.getInputAsString(); this.r = new CharSequenceReader(in); this.buff = new char[in.length() < 1024 ? in.length() : 1024]; } else { Reader _r = pipe.getReader(); if (_r instanceof ParserReader) this.r = ((ParserReader)_r).r; else this.r = _r; this.buff = new char[1024]; } pipe.setPositionable(this); }