Package net.sf.gridarta.model.io
Class AbstractAnimationObjectsReader
- java.lang.Object
-
- net.sf.gridarta.model.io.AbstractAnimationObjectsReader
-
- Direct Known Subclasses:
AtrinikAnimationObjectsReader,CrossfireAnimationObjectsReader,DaimoninAnimationObjectsReader
public abstract class AbstractAnimationObjectsReader extends java.lang.ObjectUtility class for readingAnimationObjectsfrom files.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractAnimationObjectsReader()Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidloadAnimations(@NotNull AnimationObjects animationObjects, @NotNull ErrorViewCollector errorViewCollector, @NotNull java.lang.String path, @NotNull java.io.File animFile, @NotNull java.lang.String startKey)Loads animations from a file.voidloadAnimations(@NotNull AnimationObjects animationObjects, @NotNull ErrorViewCollector errorViewCollector, java.io.Reader reader, @NotNull java.lang.String startKey, @Nullable java.lang.String path, @Nullable java.util.Map<java.lang.String,java.lang.String> animations)Loads any number of animations from a reader.protected abstract intparseLine(@NotNull java.lang.String line, int startLineNumber, @NotNull java.io.BufferedReader in, @NotNull ErrorViewCollector errorViewCollector)Parses a line.
-
-
-
Method Detail
-
loadAnimations
public void loadAnimations(@NotNull @NotNull AnimationObjects animationObjects, @NotNull @NotNull ErrorViewCollector errorViewCollector, @NotNull @NotNull java.lang.String path, @NotNull @NotNull java.io.File animFile, @NotNull @NotNull java.lang.String startKey) throws java.io.IOException, AnimationParseExceptionLoads animations from a file.- Parameters:
animationObjects- the animation objects to updateerrorViewCollector- the error view collector for reporting errorspath- the animation pathanimFile- file to load animations fromstartKey- the key that begins an animation block; it must end with a space character- Throws:
java.io.IOException- in case of I/O errorsjava.io.FileNotFoundException- in case the file couldn't be openedAnimationParseException- in case parsing the animation reveals errors
-
loadAnimations
public void loadAnimations(@NotNull @NotNull AnimationObjects animationObjects, @NotNull @NotNull ErrorViewCollector errorViewCollector, java.io.Reader reader, @NotNull @NotNull java.lang.String startKey, @Nullable @Nullable java.lang.String path, @Nullable @Nullable java.util.Map<java.lang.String,java.lang.String> animations) throws AnimationParseException, java.io.IOExceptionLoads any number of animations from a reader. It is not necessary to provide a BufferedReader for buffering. This method will always wrap the suppliedreaderwith a BufferedReader if the supplied reader isn't already a BufferedReader itself.- Parameters:
animationObjects- the animation objects to updateerrorViewCollector- the error view collector for reporting errorsreader- the reader to load animations fromstartKey- the key that begins an animation block; it must end with a space characterpath- the path relative to the arch directory, used to create tree information; eitheranimationsor this parameter must be non-nullanimations- maps animation name to animation path; eitherpathor this parameter must be non-null- Throws:
AnimationParseException- in case parsing the animation reveals errorsjava.io.IOException- in case of I/O errors
-
parseLine
protected abstract int parseLine(@NotNull @NotNull java.lang.String line, int startLineNumber, @NotNull @NotNull java.io.BufferedReader in, @NotNull @NotNull ErrorViewCollector errorViewCollector) throws AnimationParseException, java.io.IOExceptionParses a line.- Parameters:
line- the current linestartLineNumber- the current line numberin- the reader to read fromerrorViewCollector- the error view collector for reporting errors- Returns:
- the number of processed lines or -1 if the line could not be parsed
- Throws:
AnimationParseException- in case parsing the animation reveals errorsjava.io.IOException- in case of I/O errors
-
-