コード例 #1
0
        public static String getMethodDescriptor(Type returnType, params Type[] argumentTypes)
        {
            StringBuilder buf = new StringBuilder();

            buf.append('(');
            for (int i = 0; i < argumentTypes.Length; ++i)
            {
                argumentTypes[i].getDescriptor(buf);
            }
            buf.append(')');
            returnType.getDescriptor(buf);
            return(buf.toString());
        }
コード例 #2
0
 internal virtual Item newConstItem(Object cst)
 {
     if (cst is int)
     {
         int val = (int)cst;
         return(newInteger(val));
     }
     else if (cst is byte)
     {
         int val = (byte)cst;
         return(newInteger(val));
     }
     else if (cst is char)
     {
         int val = (char)cst;
         return(newInteger(val));
     }
     else if (cst is short)
     {
         int val = (short)cst;
         return(newInteger(val));
     }
     else if (cst is bool)
     {
         int val = (bool)cst ? 1 : 0;
         return(newInteger(val));
     }
     else if (cst is float)
     {
         float val = (float)cst;
         return(newFloat(val));
     }
     else if (cst is long)
     {
         long val = (long)cst;
         return(newLong(val));
     }
     else if (cst is double)
     {
         double val = (double)cst;
         return(newDouble(val));
     }
     else if (cst is String)
     {
         return(newString((String)cst));
     }
     else if (cst is Type)
     {
         Type t = (Type)cst;
         int  s = t.getSort();
         if (s == Type.OBJECT)
         {
             return(newClassItem(t.getInternalName()));
         }
         else if (s == Type.METHOD)
         {
             return(newMethodTypeItem(t.getDescriptor()));
         }
         else
         {
             return(newClassItem(t.getDescriptor()));
         }
     }
     else if (cst is Handle)
     {
         Handle h = (Handle)cst;
         return(newHandleItem(h.tag, h.owner, h.name, h.desc, h.itf));
     }
     else
     {
         throw new IllegalArgumentException("value " + cst);
     }
 }