Package org.cadixdev.lorenz.io
Class TextMappingsReader
- java.lang.Object
-
- org.cadixdev.lorenz.io.MappingsReader
-
- org.cadixdev.lorenz.io.TextMappingsReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
CSrgReader,SrgReader,TSrgReader,XSrgReader
public abstract class TextMappingsReader extends MappingsReader
An implementation ofMappingsReaderdesigned to aid with the implementation of mapping readers for text-based mapping formats.- Since:
- 0.4.0
- See Also:
SrgReader,CSrgReader,TSrgReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTextMappingsReader.ProcessorA parser for a given mappings format.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.function.Function<MappingSet,TextMappingsReader.Processor>processorprotected java.io.BufferedReaderreader
-
Constructor Summary
Constructors Modifier Constructor Description protectedTextMappingsReader(java.io.Reader reader, java.util.function.Function<MappingSet,TextMappingsReader.Processor> processor)Creates a new mappings reader, for the givenReader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()MappingSetread(MappingSet mappings)Reads mappings from the previously givenInputStream, to the givenMappingSet.-
Methods inherited from class org.cadixdev.lorenz.io.MappingsReader
read
-
-
-
-
Field Detail
-
reader
protected final java.io.BufferedReader reader
-
processor
protected final java.util.function.Function<MappingSet,TextMappingsReader.Processor> processor
-
-
Constructor Detail
-
TextMappingsReader
protected TextMappingsReader(java.io.Reader reader, java.util.function.Function<MappingSet,TextMappingsReader.Processor> processor)Creates a new mappings reader, for the givenReader.- Parameters:
reader- The readerprocessor- The line processor to use for reading the lines
-
-
Method Detail
-
read
public MappingSet read(MappingSet mappings)
Description copied from class:MappingsReaderReads mappings from the previously givenInputStream, to the givenMappingSet.- Specified by:
readin classMappingsReader- Parameters:
mappings- The mapping set- Returns:
- The mapping set, to allow for chaining
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
-