Class ParseUtils
- java.lang.Object
-
- com.realtime.crossfire.jxclient.skin.io.ParseUtils
-
public class ParseUtils extends java.lang.ObjectUtility class for parsing string parameters into values.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull CheckBoxOptionparseCheckBoxOption(@NotNull java.lang.String name, @NotNull OptionManager optionManager)Parses a check box option name.static @NotNull java.awt.ColorparseColor(@NotNull java.lang.String name)Parses a color name.static @Nullable java.awt.ColorparseColorNull(@NotNull java.lang.String name)Parses a color name, optionally followed by "/<alpha>".static @NotNull OrientationparseOrientation(@NotNull java.lang.String name)Parses an orientation value.static intparseStat(@NotNull java.lang.String name)Parses a stat value.static @NotNull java.lang.StringparseText(@NotNull Args args, @NotNull java.io.LineNumberReader lnr)Concatenates trailing arguments into a string.
-
-
-
Method Detail
-
parseStat
public static int parseStat(@NotNull @NotNull java.lang.String name) throws java.io.IOExceptionParses a stat value.- Parameters:
name- the stat value to parse- Returns:
- the stat value
- Throws:
java.io.IOException- if the stat value does not exist
-
parseOrientation
@NotNull public static @NotNull Orientation parseOrientation(@NotNull @NotNull java.lang.String name) throws java.io.IOException
Parses an orientation value.- Parameters:
name- the orientation value to parse- Returns:
- the orientation
- Throws:
java.io.IOException- if the orientation value does not exist
-
parseColor
@NotNull public static @NotNull java.awt.Color parseColor(@NotNull @NotNull java.lang.String name) throws java.io.IOExceptionParses a color name.- Parameters:
name- the color name to parse- Returns:
- the color
- Throws:
java.io.IOException- if the color name does not exist
-
parseColorNull
@Nullable public static @Nullable java.awt.Color parseColorNull(@NotNull @NotNull java.lang.String name)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 java.lang.String parseText(@NotNull @NotNull Args args, @NotNull @NotNull java.io.LineNumberReader lnr) throws java.io.IOExceptionConcatenates 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:
java.io.IOException- if reading fromlnrfails
-
parseCheckBoxOption
@NotNull public static @NotNull CheckBoxOption parseCheckBoxOption(@NotNull @NotNull java.lang.String name, @NotNull @NotNull OptionManager optionManager) throws java.io.IOException
Parses a check box option name.- Parameters:
name- the check box option name to parseoptionManager- the option manager to use- Returns:
- the check box option
- Throws:
java.io.IOException- if the check box option name does not exist
-
-