Class ParseUtils

java.lang.Object
com.realtime.crossfire.jxclient.skin.io.ParseUtils

public class ParseUtils extends Object
Utility class for parsing string parameters into values.
  • Method Details

    • parseStat

      public static int parseStat(@NotNull @NotNull String name) throws IOException
      Parses a stat value.
      Parameters:
      name - the stat value to parse
      Returns:
      the stat value
      Throws:
      IOException - if the stat value does not exist
    • parseOrientation

      @NotNull public static @NotNull Orientation parseOrientation(@NotNull @NotNull String name) throws IOException
      Parses an orientation value.
      Parameters:
      name - the orientation value to parse
      Returns:
      the orientation
      Throws:
      IOException - if the orientation value does not exist
    • parseColor

      @NotNull public static @NotNull Color parseColor(@NotNull @NotNull String name) throws IOException
      Parses a color name.
      Parameters:
      name - the color name to parse
      Returns:
      the color
      Throws:
      IOException - if the color name does not exist
    • parseColorNull

      @Nullable public static @Nullable Color parseColorNull(@NotNull @NotNull String name)
      Parses a color name, optionally followed by "/<alpha>".
      Parameters:
      name - the color name to parse
      Returns:
      the color or null if the color name does not exist
    • parseText

      @NotNull public static @NotNull String parseText(@NotNull @NotNull Args args, @NotNull @NotNull LineNumberReader lnr) throws IOException
      Concatenates trailing arguments into a string. If the first line is "<<EOF", all text up to the next line containing only "EOF" is appended. Comments starting with "#" are dropped.
      Parameters:
      args - the args to concatenate
      lnr - where to read additional lines from
      Returns:
      the concatenated string
      Throws:
      IOException - if reading from lnr fails
    • parseCheckBoxOption

      @NotNull public static @NotNull CheckBoxOption parseCheckBoxOption(@NotNull @NotNull String name, @NotNull @NotNull OptionManager optionManager) throws IOException
      Parses a checkbox option name.
      Parameters:
      name - the checkbox option name to parse
      optionManager - the option manager to use
      Returns:
      the checkbox option
      Throws:
      IOException - if the checkbox option name does not exist