Package net.sf.gridarta.model.io
Class AbstractMapArchObjectParser<A extends MapArchObject<A>>
- java.lang.Object
-
- net.sf.gridarta.model.io.AbstractMapArchObjectParser<A>
-
- All Implemented Interfaces:
MapArchObjectParser<A>
- Direct Known Subclasses:
MapArchObjectParser,MapArchObjectParser,MapArchObjectParser
public abstract class AbstractMapArchObjectParser<A extends MapArchObject<A>> extends java.lang.Object implements MapArchObjectParser<A>
Abstract base class for classes implementingMapArchObjectParsers. This class contains the common code for reading map game objects. Subclasses can extend the parser (parseLine(String, String, String, MapArchObject, BufferedReader). No support for writing is present.
-
-
Constructor Summary
Constructors Constructor Description AbstractMapArchObjectParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidload(@NotNull java.io.BufferedReader reader, A mapArchObject)Parse a map arch object from a stream.protected abstract booleanparseLine(@NotNull java.lang.String line, @NotNull java.lang.String key, @NotNull java.lang.String value, A mapArchObject, @NotNull java.io.BufferedReader reader)Parse a line for this editor type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.gridarta.model.io.MapArchObjectParser
save
-
-
-
-
Method Detail
-
load
public void load(@NotNull @NotNull java.io.BufferedReader reader, @NotNull A mapArchObject) throws java.io.IOExceptionDescription copied from interface:MapArchObjectParserParse a map arch object from a stream.- Specified by:
loadin interfaceMapArchObjectParser<A extends MapArchObject<A>>- Parameters:
reader- the stream to readmapArchObject- the map arch object to update- Throws:
java.io.IOException- if the stream cannot be read or if a parsing error occurs; the map arch object may have been partially updated
-
parseLine
protected abstract boolean parseLine(@NotNull @NotNull java.lang.String line, @NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String value, @NotNull A mapArchObject, @NotNull @NotNull java.io.BufferedReader reader) throws java.io.IOExceptionParse a line for this editor type.- Parameters:
line- the line to parsekey- the key fromlinevalue- the value fromline; the empty string if the line contains no valuemapArchObject- the map arch object to updatereader- the reader for reading additional lines- Returns:
- true=the line has been consumed; false=parsing is done
- Throws:
java.io.IOException- if an I/O error occurs or if the line cannot be parsed
-
-