Class AbstractAnimationObjectsReader

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void loadAnimations​(@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.
      void loadAnimations​(@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 int parseLine​(@NotNull java.lang.String line, int startLineNumber, @NotNull java.io.BufferedReader in, @NotNull ErrorViewCollector errorViewCollector)
      Parses a line.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractAnimationObjectsReader

        protected AbstractAnimationObjectsReader()
        Creates a new instance.
    • 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,
                                   AnimationParseException
        Loads animations from a file.
        Parameters:
        animationObjects - the animation objects to update
        errorViewCollector - the error view collector for reporting errors
        path - the animation path
        animFile - file to load animations from
        startKey - the key that begins an animation block; it must end with a space character
        Throws:
        java.io.IOException - in case of I/O errors
        java.io.FileNotFoundException - in case the file couldn't be opened
        AnimationParseException - 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.IOException
        Loads any number of animations from a reader. It is not necessary to provide a BufferedReader for buffering. This method will always wrap the supplied reader with a BufferedReader if the supplied reader isn't already a BufferedReader itself.
        Parameters:
        animationObjects - the animation objects to update
        errorViewCollector - the error view collector for reporting errors
        reader - the reader to load animations from
        startKey - the key that begins an animation block; it must end with a space character
        path - the path relative to the arch directory, used to create tree information; either animations or this parameter must be non-null
        animations - maps animation name to animation path; either path or this parameter must be non-null
        Throws:
        AnimationParseException - in case parsing the animation reveals errors
        java.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.IOException
        Parses a line.
        Parameters:
        line - the current line
        startLineNumber - the current line number
        in - the reader to read from
        errorViewCollector - 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 errors
        java.io.IOException - in case of I/O errors