com.taco.swinger.text2gui
Class StringToKeyCodeConverter

java.lang.Object
  extended by com.taco.text.AbstractStringToObjectConverter
      extended by com.taco.swinger.text2gui.StringToKeyCodeConverter
All Implemented Interfaces:
IStringToObjectConverter, IObjectMapper

public final class StringToKeyCodeConverter
extends AbstractStringToObjectConverter

A converter from strings to key codes.


Field Summary
static StringToKeyCodeConverter instance
          The singleton instance of this class.
 
Method Summary
static int toKeyCode(java.lang.String s)
          Look for a field in KeyEvent named "VK_" + s.toUpperCase().
 java.lang.Object toObject(java.lang.String s)
          Return an Integer wrapping the key code returned by toKeyCode(s).
 
Methods inherited from class com.taco.text.AbstractStringToObjectConverter
map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static final StringToKeyCodeConverter instance
The singleton instance of this class.

Method Detail

toObject

public java.lang.Object toObject(java.lang.String s)
                          throws java.text.ParseException
Return an Integer wrapping the key code returned by toKeyCode(s).

Throws:
java.text.ParseException

toKeyCode

public static final int toKeyCode(java.lang.String s)
                           throws java.text.ParseException
Look for a field in KeyEvent named "VK_" + s.toUpperCase(). If no such field exists, throw a ParseException.

Throws:
java.text.ParseException