com.realtime.crossfire.jxclient.skin.io
Class ParseUtils

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

public class ParseUtils
extends java.lang.Object

Utility class for parsing string parameters into values.


Constructor Summary
private ParseUtils()
          Private constructor to prevent instantiation.
 
Method Summary
static CheckBoxOption parseCheckBoxOption(java.lang.String name, OptionManager optionManager)
          Parses a check box option name.
static java.awt.Color parseColor(java.lang.String name)
          Parses a color name.
private static java.awt.Color parseColorName(java.lang.String name)
          Parses a color name.
static java.awt.Color parseColorNull(java.lang.String name)
          Parses a color name, optionally followed by "/<alpha>".
static Orientation parseOrientation(java.lang.String name)
          Parses an orientation value.
static int parseStat(java.lang.String name)
          Parses a stat value.
static java.lang.String parseText(Args args, java.io.LineNumberReader lnr)
          Concatenates trailing arguments into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseUtils

private ParseUtils()
Private constructor to prevent instantiation.

Method Detail

parseCheckBoxOption

@NotNull
public static CheckBoxOption parseCheckBoxOption(@NotNull
                                                         java.lang.String name,
                                                         @NotNull
                                                         OptionManager optionManager)
                                          throws java.io.IOException
Parses a check box option name.

Parameters:
name - the check box option name to parse
optionManager - the option manager to use
Returns:
the check box option
Throws:
java.io.IOException - if the check box option name does not exist

parseColor

@NotNull
public static java.awt.Color parseColor(@NotNull
                                                java.lang.String name)
                                 throws java.io.IOException
Parses a color name.

Parameters:
name - the color name to parse
Returns:
the color
Throws:
java.io.IOException - if the color name does not exist

parseColorName

@Nullable
private static java.awt.Color parseColorName(@NotNull
                                                      java.lang.String name)
Parses a color name.

Parameters:
name - the color name to parse
Returns:
the color or null if the color name does not exist

parseColorNull

@Nullable
public static java.awt.Color parseColorNull(@NotNull
                                                     java.lang.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

parseOrientation

@NotNull
public static Orientation parseOrientation(@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

parseStat

public static int parseStat(@NotNull
                            java.lang.String name)
                     throws java.io.IOException
Parses 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

parseText

@NotNull
public static java.lang.String parseText(@NotNull
                                                 Args args,
                                                 @NotNull
                                                 java.io.LineNumberReader lnr)
                                  throws java.io.IOException
Concatenates trailing arguments into a string. If the first line is "<
Parameters:
args - the args to concatenate
lnr - where to read additional lines from
Returns:
the concatenated string
Throws:
java.io.IOException - if reading from lnr fails