1 22 package org.jboss.iiop.rmi; 23 24 import org.omg.CORBA.Any ; 25 26 27 36 public class ConstantAnalysis 37 extends AbstractAnalysis 38 { 39 41 43 45 47 ConstantAnalysis(String javaName, Class type, Object value) 48 { 49 super(javaName); 50 51 if (type == Void.TYPE || 52 !type.isPrimitive() && type != java.lang.String .class) 53 throw new IllegalArgumentException ("Bad type for constant: " + 54 type.getName()); 55 56 this.type = type; 57 this.value = value; 58 } 59 60 62 65 public Class getType() 66 { 67 return type; 68 } 69 70 73 public Object getValue() 74 { 75 return value; 76 } 77 78 81 public void insertValue(Any any) 82 { 83 if (type == String .class) 84 any.insert_wstring((String )value); else 86 Util.insertAnyPrimitive(any, value); 87 } 88 89 91 93 96 private Class type; 97 98 101 private Object value; 102 103 } 104 105 | Popular Tags |