SWIXML
1.6 (#161)

org.swixml.converters
Class ColorConverter

java.lang.Object
  extended by org.swixml.converters.ColorConverter
All Implemented Interfaces:
Converter

public class ColorConverter
extends Object
implements Converter

The ColorConverter class defines a Converter that turns the Strings into a Color object

Version:
$Revision: 1.1 $
Author:
Wolf Paulus
See Also:

Examples for Valid XML attribute notations:

The following example show valid xml attributes to create Color objects:
  • background="3399CC"
  • background="red"
  • foreground="991144"

Field Summary
static Class TEMPLATE
          converter's return type
 
Constructor Summary
ColorConverter()
           
 
Method Summary
static Object conv(Class type, Attribute attr)
          Returns a java.awt.Color runtime object
 Object convert(Class type, Attribute attr, Localizer localizer)
          Returns a java.awt.Color runtime object
 Class convertsTo()
          A Converters conversTo method informs about the Class type the converter is returning when its convert method is called
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMPLATE

public static final Class TEMPLATE
converter's return type

Constructor Detail

ColorConverter

public ColorConverter()
Method Detail

convert

public Object convert(Class type,
                      Attribute attr,
                      Localizer localizer)
Returns a java.awt.Color runtime object

Specified by:
convert in interface Converter
Parameters:
type - Class not used
attr - Attribute value needs to provide a String
Returns:
runtime type is subclass of java.awt.Color

conv

public static Object conv(Class type,
                          Attribute attr)
Returns a java.awt.Color runtime object

Parameters:
type - Class not used
attr - Attribute value needs to provide a String
Returns:
runtime type is subclass of java.awt.Color

convertsTo

public Class convertsTo()
A Converters conversTo method informs about the Class type the converter is returning when its convert method is called

Specified by:
convertsTo in interface Converter
Returns:
Class - the Class the converter is returning when its convert method is called

SWIXML
1.6 (#161)

Copyright � 2002 - 2011 - Wolf Paulus - wolfpaulus.com. All rights reserved.