- java.lang.Object
-
- org.mal_lang.langspec.io.LangReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class LangReader extends Object implements Closeable
Reads.marfiles intoLangobjects.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description LangReader(InputStream in)Constructs a newLangReaderobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this stream and releases any system resources associated with it.Langread()Returns aLangobject that is represented in the input source.Langread(boolean readIcons, boolean readLicense)Returns aLangobject that is represented in the input source.
-
-
-
Constructor Detail
-
LangReader
public LangReader(InputStream in)
Constructs a newLangReaderobject.- Parameters:
in- an input stream from which a.marfile is to be read- Throws:
NullPointerException- ifinisnull- Since:
- 1.0.0
-
-
Method Detail
-
read
public Lang read() throws IOException
Returns aLangobject that is represented in the input source. This method needs to be called only once for a reader instance.- Returns:
- a
Langobject - Throws:
IOException- if an I/O error occursIllegalStateException- ifreadorclosemethod is already called- Since:
- 1.0.0
-
read
public Lang read(boolean readIcons, boolean readLicense) throws IOException
Returns aLangobject 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
Langobject - Throws:
IOException- if an I/O error occursIllegalStateException- ifreadorclosemethod is already called- Since:
- 1.0.0
-
close
public void close() throws IOExceptionCloses 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an I/O error occurs- Since:
- 1.0.0
-
-