org.swixml
Class ConverterLibrary
java.lang.Object
org.swixml.ConverterLibrary
public class ConverterLibrary
extends java.lang.Object
The
ConverterLibrary
contains all available Coverters, converting Strings.
General purpose data type converters are able to convert Strings into objects that are
usually as parameters when setters are called on javax.swing objects.
Available Converter include converters able to produce
- Primitives
- Dimension
- Color
- Border
- etc.
Example String inputs could look like this:
- MatteBorder(4,4,4,4,red)
- FFCCEE
- BorderLayout.CENTER
- 2,2,2,2
Date: Dec 16, 2002
getConverter
public Converter getConverter(Class template)
Returns a Converter
instance, able to produce obejcts of the given class
template
- Class
Class of the object the Converter
needs to produce.
Converter
- instance of the given Converter class.
getConverters
public Map getConverters()
Map
- all registered converters.
Use a class to get to the converters
getInstance
public static ConverterLibrary getInstance()
ConverterLibrary
the single INstacne of the ConverterLibarary.
hasConverter
public boolean hasConverter(Class template)
Indicates if a the ConverterLibary has a Converter producing instances of the given Class.
boolean
true, if the ConverterLibrary has a Converter to produce an instances of the gioven class.
register
public void register(Class template,
Converter converter)
Registers a Converter with the ConverterLibrary
template
- Class
type of the objects the Converter createsconverter
- Converter
Instance of Converter able to vconvert Strings into objects of the given type
Copyright B) 2002 - 2005 - Wolf Paulus - CarlsbadCubes.com . All rights reserved.