- java.lang.Object
-
- org.mal_lang.langspec.io.LangReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class LangReader extends Object implements Closeable
Reads.mar
files intoLang
objects.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description LangReader(InputStream in)
Constructs a newLangReader
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this stream and releases any system resources associated with it.Lang
read()
Returns aLang
object that is represented in the input source.Lang
read(boolean readIcons, boolean readLicense)
Returns aLang
object that is represented in the input source.
-
-
-
Constructor Detail
-
LangReader
public LangReader(InputStream in)
Constructs a newLangReader
object.- Parameters:
in
- an input stream from which a.mar
file is to be read- Throws:
NullPointerException
- ifin
isnull
- Since:
- 1.0.0
-
-
Method Detail
-
read
public Lang read() throws IOException
Returns aLang
object that is represented in the input source. This method needs to be called only once for a reader instance.- Returns:
- a
Lang
object - Throws:
IOException
- if an I/O error occursIllegalStateException
- ifread
orclose
method is already called- Since:
- 1.0.0
-
read
public Lang read(boolean readIcons, boolean readLicense) throws IOException
Returns aLang
object that is represented in the input source. This method needs to be called only once for a reader instance.- Parameters:
readIcons
- whether icons should be readreadLicense
- whether license and notice should be read- Returns:
- a
Lang
object - Throws:
IOException
- if an I/O error occursIllegalStateException
- ifread
orclose
method is already called- Since:
- 1.0.0
-
close
public void close() throws IOException
Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- if an I/O error occurs- Since:
- 1.0.0
-
-