Package javassist

Examples of javassist.CtPrimitiveType


/* 202 */           buffer.append('[');
/* 203 */           temp = temp.getComponentType();
/*     */         }
/* 205 */         if (temp.isPrimitive())
/*     */         {
/* 207 */           CtPrimitiveType primitive = (CtPrimitiveType)temp;
/* 208 */           buffer.append(Character.toString(primitive.getDescriptor()));
/*     */         }
/*     */         else
/*     */         {
/* 212 */           buffer.append('L');
/* 213 */           buffer.append(temp.getName());
View Full Code Here


/* 178 */     int index = 0;
/* 179 */     int dim = 1;
/*     */     int codeLength;
/* 181 */     if (this.opcode == 188) {
/* 182 */       index = this.iterator.byteAt(this.currentPos + 1);
/* 183 */       CtPrimitiveType cpt = (CtPrimitiveType)getPrimitiveType(index);
/* 184 */       String desc = "[" + cpt.getDescriptor();
/* 185 */       codeLength = 2;
/*     */     }
/*     */     else
/*     */     {
/*     */       int codeLength;
View Full Code Here

/*      */   public void addReturn(CtClass type)
/*      */   {
/* 1366 */     if (type == null) {
/* 1367 */       addOpcode(177);
/* 1368 */     } else if (type.isPrimitive()) {
/* 1369 */       CtPrimitiveType ptype = (CtPrimitiveType)type;
/* 1370 */       addOpcode(ptype.getReturnOp());
/*      */     }
/*      */     else {
/* 1373 */       addOpcode(176);
/*      */     }
/*      */   }
View Full Code Here

/* 259 */         desc.append(toJvmName(name.substring(0, name.length() - 2)));
/* 260 */         desc.append(';');
/*     */       }
/*     */     }
/* 263 */     else if (type.isPrimitive()) {
/* 264 */       CtPrimitiveType pt = (CtPrimitiveType)type;
/* 265 */       desc.append(pt.getDescriptor());
/*     */     }
/*     */     else {
/* 268 */       desc.append('L');
/* 269 */       desc.append(type.getName().replace('.', '/'));
/* 270 */       desc.append(';');
View Full Code Here

/* 111 */     CtClass returnType = this.codeGen.returnType;
/* 112 */     expr.getOprand().accept(this);
/* 113 */     if ((this.exprType == 344) || (CodeGen.isRefType(this.exprType)) || (this.arrayDim > 0)) {
/* 114 */       compileUnwrapValue(returnType);
/* 115 */     } else if ((returnType instanceof CtPrimitiveType)) {
/* 116 */       CtPrimitiveType pt = (CtPrimitiveType)returnType;
/* 117 */       int destType = MemberResolver.descToType(pt.getDescriptor());
/* 118 */       this.exprType = destType;
/* 119 */       this.arrayDim = 0;
/* 120 */       this.className = null;
/*     */     }
/*     */   }
View Full Code Here

/* 258 */     setType(type, 0);
/*     */   }
/*     */
/*     */   private void setType(CtClass type, int dim) throws CompileError {
/* 262 */     if (type.isPrimitive()) {
/* 263 */       CtPrimitiveType pt = (CtPrimitiveType)type;
/* 264 */       this.exprType = MemberResolver.descToType(pt.getDescriptor());
/* 265 */       this.arrayDim = dim;
/* 266 */       this.className = null;
/*     */     }
/* 268 */     else if (type.isArray()) {
/*     */       try {
View Full Code Here

/*     */   {
/*     */     int value;
/*     */     int op;
/*     */     int value;
/* 235 */     if ((type instanceof CtPrimitiveType)) {
/* 236 */       CtPrimitiveType pt = (CtPrimitiveType)type;
/* 237 */       int op = pt.getReturnOp();
/*     */       int value;
/* 238 */       if (op == 175) {
/* 239 */         value = 14;
/*     */       }
/*     */       else
View Full Code Here

/*     */   {
/* 185 */     expr.getOprand().accept(this);
/* 186 */     if ((this.exprType == 344) || (isRefType(this.exprType)) || (this.arrayDim > 0)) {
/* 187 */       compileUnwrapValue(this.returnType, this.bytecode);
/* 188 */     } else if ((this.returnType instanceof CtPrimitiveType)) {
/* 189 */       CtPrimitiveType pt = (CtPrimitiveType)this.returnType;
/* 190 */       int destType = MemberResolver.descToType(pt.getDescriptor());
/* 191 */       atNumCastExpr(this.exprType, destType);
/* 192 */       this.exprType = destType;
/* 193 */       this.arrayDim = 0;
/* 194 */       this.className = null;
/*     */     }
View Full Code Here

/* 202 */     if ((isRefType(this.exprType)) || (this.arrayDim > 0)) {
/* 203 */       return;
/*     */     }
/* 205 */     CtClass clazz = this.resolver.lookupClass(this.exprType, this.arrayDim, this.className);
/* 206 */     if ((clazz instanceof CtPrimitiveType)) {
/* 207 */       CtPrimitiveType pt = (CtPrimitiveType)clazz;
/* 208 */       String wrapper = pt.getWrapperName();
/* 209 */       this.bytecode.addNew(wrapper);
/* 210 */       this.bytecode.addOpcode(89);
/* 211 */       if (pt.getDataSize() > 1)
/* 212 */         this.bytecode.addOpcode(94);
/*     */       else {
/* 214 */         this.bytecode.addOpcode(93);
/*     */       }
/* 216 */       this.bytecode.addOpcode(88);
/* 217 */       this.bytecode.addInvokespecial(wrapper, "<init>", "(" + pt.getDescriptor() + ")V");
/*     */
/* 220 */       this.exprType = 307;
/* 221 */       this.arrayDim = 0;
/* 222 */       this.className = "java/lang/Object";
/*     */     }
View Full Code Here

/* 615 */     code.addAnewarray("java.lang.Object");
/* 616 */     for (int i = 0; i < n; i++) {
/* 617 */       code.addOpcode(89);
/* 618 */       code.addIconst(i);
/* 619 */       if (params[i].isPrimitive()) {
/* 620 */         CtPrimitiveType pt = (CtPrimitiveType)params[i];
/* 621 */         String wrapper = pt.getWrapperName();
/* 622 */         code.addNew(wrapper);
/* 623 */         code.addOpcode(89);
/* 624 */         int s = code.addLoad(regno, pt);
/* 625 */         regno += s;
/* 626 */         args[0] = pt;
View Full Code Here

TOP

Related Classes of javassist.CtPrimitiveType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.