public class PlainTextSource extends Object implements TextSource
| Modifier and Type | Method and Description |
|---|---|
static TextSource |
forBytes(se.l4.commons.io.Bytes bytes,
Charset charset)
Create a new source using the given
Bytes to resolve the text
content. |
static TextSource |
forReader(se.l4.commons.io.IOSupplier<Reader> supplier)
Create a new source that will use the given
IoSupplier to open a
Reader. |
static TextSource |
forReader(Reader reader)
Create a new source for the given
Reader. |
static TextSource |
forStream(InputStream stream,
Charset charset)
Create a new source for the given
InputStream using the
specified character set to decode it. |
static TextSource |
forStream(se.l4.commons.io.IOSupplier<InputStream> stream,
Charset charset)
Create a new source that uses the given
IoSupplier to resolve
the text content. |
static TextSource |
forString(String text)
Create a new source for the given
String. |
void |
parse(TextSourceEncounter encounter)
Parse the source using the given encounter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitempty, processpublic static TextSource forReader(Reader reader)
Reader.reader - public static TextSource forReader(se.l4.commons.io.IOSupplier<Reader> supplier)
IoSupplier to open a
Reader.supplier - public static TextSource forStream(InputStream stream, Charset charset)
InputStream using the
specified character set to decode it.stream - charset - public static TextSource forStream(se.l4.commons.io.IOSupplier<InputStream> stream, Charset charset)
IoSupplier to resolve
the text content. The given Charset will be used to decode the
stream.stream - charset - public static TextSource forString(String text)
String.text - public static TextSource forBytes(se.l4.commons.io.Bytes bytes, Charset charset)
Bytes to resolve the text
content. The given Charset will be used to decode the content.bytes - charset - public void parse(TextSourceEncounter encounter) throws IOException
TextSourceparse in interface TextSourceIOExceptionCopyright © 2018. All rights reserved.