|
SWIXML 1.5 (#149) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.swixml.converters.PrimitiveConverter
public class PrimitiveConverter
The PrimitiveConverter
class defines a converter that creates primitive objects (wrapper),
based on a provided input Class and String.
ConverterLibrary
Field Summary | |
---|---|
static Class |
TEMPLATE
converter's return type |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface org.swixml.converters.InputEvent |
---|
ALT_DOWN_MASK, ALT_GRAPH_DOWN_MASK, ALT_GRAPH_MASK, ALT_MASK, BUTTON1_DOWN_MASK, BUTTON1_MASK, BUTTON2_DOWN_MASK, BUTTON2_MASK, BUTTON3_DOWN_MASK, BUTTON3_MASK, CTRL_DOWN_MASK, CTRL_MASK, JDK_1_3_MODIFIERS, META_DOWN_MASK, META_MASK, SHIFT_DOWN_MASK, SHIFT_MASK |
Constructor Summary | |
---|---|
PrimitiveConverter()
|
Method Summary | |
---|---|
static void |
addConstantProvider(Class clazz)
Adds a new class or interface to the dictionary of primitive providers. |
static Object |
conv(Class type,
Attribute attr,
Localizer localizer)
Converts String into java primitive type |
Object |
convert(Class type,
Attribute attr,
Localizer localizer)
Converts String into java primitive type |
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 |
---|
public static final Class TEMPLATE
Constructor Detail |
---|
public PrimitiveConverter()
Method Detail |
---|
public static Object conv(Class type, Attribute attr, Localizer localizer) throws NoSuchFieldException, IllegalAccessException
type
- Class
target typeattr
- Attribute
value field needs to provide convertable Stringlocalizer
- Localizer
Object
primitive wrapped into wrapper object
NoSuchFieldException
- in case no class a field matching field name had been regsitered with this converter
IllegalAccessException
- if a matching field can not be accessedpublic Object convert(Class type, Attribute attr, Localizer localizer) throws Exception
convert
in interface Converter
type
- Class
target typeattr
- Attribute
value field needs to provide convertable String
Object
primitive wrapped into wrapper object
Exception
public Class convertsTo()
Converters
conversTo method informs about the Class type the converter
is returning when its convert
method is called
convertsTo
in interface Converter
Class
- the Class the converter is returning when its convert method is calledpublic static void addConstantProvider(Class clazz)
clazz
- Class
providing primitive constants / public (final) fields
|
SWIXML 1.5 (#149) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |