Class ParseUtils
java.lang.Object
com.realtime.crossfire.jxclient.skin.io.ParseUtils
Utility class for parsing string parameters into values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CheckBoxOptionparseCheckBoxOption(@NotNull String name, @NotNull OptionManager optionManager) Parses a checkbox option name.static @NotNull ColorparseColor(@NotNull String name) Parses a color name.static @Nullable ColorparseColorNull(@NotNull String name) Parses a color name, optionally followed by "/<alpha>".static @NotNull OrientationparseOrientation(@NotNull String name) Parses an orientation value.static intParses a stat value.static @NotNull StringparseText(@NotNull Args args, @NotNull LineNumberReader lnr) Concatenates trailing arguments into a string.
-
Method Details
-
parseStat
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
Parses a color name.- Parameters:
name- the color name to parse- Returns:
- the color
- Throws:
IOException- if the color name does not exist
-
parseColorNull
Parses a color name, optionally followed by "/<alpha>".- Parameters:
name- the color name to parse- Returns:
- the color or
nullif 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 concatenatelnr- where to read additional lines from- Returns:
- the concatenated string
- Throws:
IOException- if reading fromlnrfails
-
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 parseoptionManager- the option manager to use- Returns:
- the checkbox option
- Throws:
IOException- if the checkbox option name does not exist
-