Class ArcheTextReader
java.lang.Object
com.blackrook.archetext.ArcheTextReader
A reader class for reading in ArcheText data and creating objects from it.
- Author:
- Matthew Tropiano
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapply(File f, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.static voidapply(File f, PreprocessorLexer.Includer includer, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.static voidapply(String text, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.static voidapply(String text, PreprocessorLexer.Includer includer, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.static voidapply(String streamName, InputStream in, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.static voidapply(String streamName, InputStream in, PreprocessorLexer.Includer includer, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.static voidapply(String streamName, Reader reader, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.static voidapply(String streamName, Reader reader, PreprocessorLexer.Includer includer, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.static ArcheTextRootReads ArcheText objects into a new root from a starting text file.static ArcheTextRootread(File file, PreprocessorLexer.Includer includer) Reads ArcheText objects into a new root from a starting text file.static ArcheTextRootReads ArcheText objects from a String of text into a new root.static ArcheTextRootread(String text, PreprocessorLexer.Includer includer) Reads ArcheText objects from a String of text into a new root.static ArcheTextRootread(String streamName, InputStream in) Reads ArcheText objects into a new root.static ArcheTextRootread(String streamName, InputStream in, PreprocessorLexer.Includer includer) Reads ArcheText objects into a new root.static ArcheTextRootReads ArcheText objects into a new root from a reader stream.static ArcheTextRootread(String streamName, Reader reader, PreprocessorLexer.Includer includer) Reads ArcheText objects into a new root from a reader stream.static ArcheTextRootreadResource(String name) Reads ArcheText objects from a classpath resource.
-
Field Details
-
STREAMNAME_TEXT
- See Also:
-
-
Method Details
-
read
Reads ArcheText objects into a new root from a starting text file. Note: Calls apply() with a new root.- Parameters:
file- the file to read from.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if f is null.
-
read
Reads ArcheText objects from a String of text into a new root. Note: Calls apply() with a new root.- Parameters:
text- the String to read from.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if f is null.
-
read
Reads ArcheText objects into a new root. Note: Calls apply() with a new root.- Parameters:
streamName- the name of the stream.in- the stream to read from.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if in is null.
-
read
Reads ArcheText objects into a new root from a reader stream. Note: Calls apply() with a new root.- Parameters:
streamName- the name of the stream.reader- the reader to read from.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if f is null.
-
read
Reads ArcheText objects into a new root from a starting text file. Note: Calls apply() with a new root.- Parameters:
file- the file to read from.includer- the includer to use to resolve "included" paths.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if f is null.
-
read
public static ArcheTextRoot read(String text, PreprocessorLexer.Includer includer) throws IOException Reads ArcheText objects from a String of text into a new root. Note: Calls apply() with a new root.- Parameters:
text- the String to read from.includer- the includer to use to resolve "included" paths.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if f is null.
-
read
public static ArcheTextRoot read(String streamName, InputStream in, PreprocessorLexer.Includer includer) throws IOException Reads ArcheText objects into a new root. Note: Calls apply() with a new root.- Parameters:
streamName- the name of the stream.in- the stream to read from.includer- the includer to use to resolve "included" paths.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if in is null.
-
read
public static ArcheTextRoot read(String streamName, Reader reader, PreprocessorLexer.Includer includer) throws IOException Reads ArcheText objects into a new root from a reader stream. Note: Calls apply() with a new root.- Parameters:
streamName- the name of the stream.reader- the reader to read from.includer- the includer to use to resolve "included" paths.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if f is null.
-
readResource
Reads ArcheText objects from a classpath resource. Note: Calls apply() with a new root.- Parameters:
name- the resource name.- Returns:
- A new ArcheTextRoot that contains all the read object hierarchy.
- Throws:
IOException- if the stream can't be read.NullPointerException- if name is null.
-
apply
Applies the ArcheText objects read to an already existing root.- Parameters:
f- the file to read from.root- the root to apply the objects to.- Throws:
IOException- if an I/O error occurs during read.NullPointerException- if either object is null.
-
apply
Applies the ArcheText objects read to an already existing root.- Parameters:
text- the String to read from.root- the root to apply the objects to.- Throws:
IOException- if an I/O error occurs during read.NullPointerException- if either object is null.
-
apply
Applies the ArcheText objects read to an already existing root.- Parameters:
streamName- the name of the stream.in- the stream to read from.root- the root to apply the objects to.- Throws:
NullPointerException- if either object is null.
-
apply
Applies the ArcheText objects read to an already existing root.- Parameters:
streamName- the name of the stream.reader- the reader to read from.root- the root to apply the objects to.- Throws:
NullPointerException- if either object is null.
-
apply
public static void apply(File f, PreprocessorLexer.Includer includer, ArcheTextRoot root) throws IOException Applies the ArcheText objects read to an already existing root.- Parameters:
f- the file to read from.includer- the includer to use to resolve "included" paths.root- the root to apply the objects to.- Throws:
IOException- if an I/O error occurs during read.NullPointerException- if either object is null.
-
apply
public static void apply(String streamName, InputStream in, PreprocessorLexer.Includer includer, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.- Parameters:
streamName- the name of the stream.in- the stream to read from.includer- the includer to use to resolve "included" paths.root- the root to apply the objects to.- Throws:
NullPointerException- if either object is null.
-
apply
public static void apply(String text, PreprocessorLexer.Includer includer, ArcheTextRoot root) throws IOException Applies the ArcheText objects read to an already existing root.- Parameters:
text- the String to read from.includer- the includer to use to resolve "included" paths.root- the root to apply the objects to.- Throws:
IOException- if an I/O error occurs during read.NullPointerException- if either object is null.
-
apply
public static void apply(String streamName, Reader reader, PreprocessorLexer.Includer includer, ArcheTextRoot root) Applies the ArcheText objects read to an already existing root.- Parameters:
streamName- the name of the stream.reader- the reader to read from.includer- the includer to use to resolve "included" paths.root- the root to apply the objects to.- Throws:
NullPointerException- if either object is null.
-