com.martiansoftware.jsap.stringparsers
Class ColorStringParser

java.lang.Object
  extended bycom.martiansoftware.jsap.StringParser
      extended bycom.martiansoftware.jsap.stringparsers.ColorStringParser

public class ColorStringParser
extends StringParser

A StringParser for parsing java.awt.Color objects. Color information can be specified in a variety of formats:

If the specified argument does not match any of these formats, a ParseException is thrown.

Author:
Marty Lamb
See Also:
StringParser, Color

Constructor Summary
ColorStringParser()
          Deprecated. Use getParser() or, even better, JSAP.COLOR_PARSER.
 
Method Summary
static ColorStringParser getParser()
          Returns a ColorStringParser.
 Object parse(String arg)
          Parses java.awt.Color objects from Strings.
 
Methods inherited from class com.martiansoftware.jsap.StringParser
setUp, tearDown
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorStringParser

public ColorStringParser()
Deprecated. Use getParser() or, even better, JSAP.COLOR_PARSER.

Creates a new ColorStringParser.

Method Detail

getParser

public static ColorStringParser getParser()
Returns a ColorStringParser.

Convenient access to the only instance returned by this method is available through JSAP.COLOR_PARSER.

Returns:
a ColorStringParser.

parse

public Object parse(String arg)
             throws ParseException
Parses java.awt.Color objects from Strings. Color information can be specified in a variety of formats: If the specified argument does not match any of these formats, a ParseException is thrown.

Specified by:
parse in class StringParser
Parameters:
arg - the String to convert to a Color object.
Returns:
the Color specified by arg.
Throws:
ParseException - if arg cannot be interpreted as a Color as described above.


Copyright © 2002-2006, Martian Software, Inc.. All Rights Reserved.
For the latest version and documentation, please visit http://www.martiansoftware.com/jsap