1 22 package org.jboss.iiop.rmi; 23 24 25 34 public class PrimitiveAnalysis 35 extends ClassAnalysis 36 { 37 39 41 43 46 static public PrimitiveAnalysis getPrimitiveAnalysis(Class cls) 47 { 48 if (cls == null) 49 throw new IllegalArgumentException ("Null class"); 50 51 if (cls == Void.TYPE) 52 return voidAnalysis; 53 if (cls == Boolean.TYPE) 54 return booleanAnalysis; 55 if (cls == Character.TYPE) 56 return charAnalysis; 57 if (cls == Byte.TYPE) 58 return byteAnalysis; 59 if (cls == Short.TYPE) 60 return shortAnalysis; 61 if (cls == Integer.TYPE) 62 return intAnalysis; 63 if (cls == Long.TYPE) 64 return longAnalysis; 65 if (cls == Float.TYPE) 66 return floatAnalysis; 67 if (cls == Double.TYPE) 68 return doubleAnalysis; 69 70 throw new IllegalArgumentException ("Not a primitive type: " + 71 cls.getName()); 72 } 73 74 public static PrimitiveAnalysis voidAnalysis = new PrimitiveAnalysis(Void.TYPE, "void", "void"); 75 public static PrimitiveAnalysis booleanAnalysis = new PrimitiveAnalysis(Boolean.TYPE, "boolean", "boolean"); 76 public static PrimitiveAnalysis charAnalysis = new PrimitiveAnalysis(Character.TYPE, "wchar", "char"); 77 public static PrimitiveAnalysis byteAnalysis = new PrimitiveAnalysis(Byte.TYPE, "octet", "byte"); 78 public static PrimitiveAnalysis shortAnalysis = new PrimitiveAnalysis(Short.TYPE, "short", "short"); 79 public static PrimitiveAnalysis intAnalysis = new PrimitiveAnalysis(Integer.TYPE, "long", "int"); 80 public static PrimitiveAnalysis longAnalysis = new PrimitiveAnalysis(Long.TYPE, "long_long", "long"); 81 public static PrimitiveAnalysis floatAnalysis = new PrimitiveAnalysis(Float.TYPE, "float", "float"); 82 public static PrimitiveAnalysis doubleAnalysis = new PrimitiveAnalysis(Double.TYPE, "double", "double"); 83 84 86 private PrimitiveAnalysis(Class cls, String idlName, String javaName) 87 { 88 super(cls, idlName, javaName); 89 } 90 91 93 95 97 99 } 100 | Popular Tags |