1 15 package org.apache.tapestry.enhance; 16 17 import java.util.HashMap ; 18 import java.util.Map ; 19 20 24 public class JavaClassMapping 25 { 26 27 31 32 private Map _typeMap = new HashMap (); 33 34 { 35 recordType("boolean", boolean.class); 36 recordType("boolean[]", boolean[].class); 37 38 recordType("short", short.class); 39 recordType("short[]", short[].class); 40 41 recordType("int", int.class); 42 recordType("int[]", int[].class); 43 44 recordType("long", long.class); 45 recordType("long[]", long[].class); 46 47 recordType("float", float.class); 48 recordType("float[]", float[].class); 49 50 recordType("double", double.class); 51 recordType("double[]", double[].class); 52 53 recordType("char", char.class); 54 recordType("char[]", char[].class); 55 56 recordType("byte", byte.class); 57 recordType("byte[]", byte[].class); 58 59 recordType("java.lang.Object", Object .class); 60 recordType("java.lang.Object[]", Object [].class); 61 62 recordType("java.lang.String", String .class); 63 recordType("java.lang.String[]", String [].class); 64 } 65 66 public void recordType(String name, Class type) 67 { 68 _typeMap.put(name, type); 69 } 70 71 public Class getType(String name) 72 { 73 return (Class ) _typeMap.get(name); 74 } 75 76 } 77 | Popular Tags |