1 18 19 package org.objectweb.kilim.description; 20 21 import java.util.Iterator ; 22 import java.util.LinkedList ; 23 24 29 public abstract class KILIM { 30 31 32 public static final int PORT = 1; 33 34 public static final int PROPERTY = 2; 35 36 37 public static final int GETTER = 3; 38 39 public static final int SETTER = 4; 40 41 public static final int METHOD = 5; 42 43 public static final int CONSTRUCTOR = 6; 44 45 46 public static final int REFERENCE = 7; 47 48 public static final int CLASS = 8; 49 50 public static final int ARRAY = 9; 51 52 53 public static final int EVENT_SOURCE = 10; 54 55 56 public static final int NULL_ELEMENT = 11; 57 58 public static final int PROVIDER = 12; 59 60 public static final int TRANSFORMER = 13; 61 62 63 public static final LinkedList EMPTY_LIST = new LinkedList (); 64 65 public static final Iterator EMPTY_ITERATOR = EMPTY_LIST.listIterator(); 66 67 68 public static final int PRIVATE = 1; 69 70 public static final int PROTECTED = 2; 71 72 public static final int PUBLIC = 3; 73 74 public static final int UNDEFINED_STATUS = 0; 75 76 77 public static final int BOOLEAN = 1; 78 79 public static final int CHAR = 2; 80 81 public static final int BYTE = 3; 82 83 public static final int SHORT = 4; 84 85 public static final int INT = 5; 86 87 public static final int LONG = 6; 88 89 public static final int FLOAT = 7; 90 91 public static final int DOUBLE = 8; 92 93 public static final int STRING = 9; 94 95 public static final int OBJECT = 10; 96 97 public static final int UNDEFINED_TYPE = 0; 98 99 100 public static final String [] CLASS_NAME = { "", "java.lang.Boolean", "java.lang.Character", "java.lang.Byte", "java.lang.Short", 101 "java.lang.Integer", "java.lang.Long", "java.lang.Float", "java.lang.Double", "java.lang.String", "java.lang.Object" }; 102 103 private static int uniqueIndex = 0; 104 105 110 public static int getUniqueIndex() { 111 return uniqueIndex++; 112 } 113 114 120 public static Class getClassFromName(String name) throws ClassNotFoundException { 121 if (name.equals("boolean")) { 122 return boolean.class; 123 } else if (name.equals("byte")) { 124 return byte.class; 125 } else if (name.equals("short")) { 126 return short.class; 127 } else if (name.equals("int")) { 128 return int.class; 129 } else if (name.equals("long")) { 130 return long.class; 131 } else if (name.equals("float")) { 132 return float.class; 133 } else if (name.equals("double")) { 134 return double.class; 135 } else if (name.equals("char")) { 136 return char.class; 137 } else { 138 return Class.forName(name); 139 } 140 } 141 } | Popular Tags |