Package javassist

Examples of javassist.CtPrimitiveType


/*     */
/* 651 */     if (this.exprType == 344) {
/* 652 */       throw new CompileError("invalid type for " + this.returnCastName);
/*     */     }
/* 654 */     if ((type instanceof CtPrimitiveType)) {
/* 655 */       CtPrimitiveType pt = (CtPrimitiveType)type;
/*     */
/* 657 */       String wrapper = pt.getWrapperName();
/* 658 */       code.addCheckcast(wrapper);
/* 659 */       code.addInvokevirtual(wrapper, pt.getGetMethodName(), pt.getGetMethodDescriptor());
/*     */
/* 661 */       setType(type);
/*     */     }
/*     */     else {
/* 664 */       code.addCheckcast(type);
View Full Code Here


/* 673 */     setType(type, 0);
/*     */   }
/*     */
/*     */   private void setType(CtClass type, int dim) throws CompileError {
/* 677 */     if (type.isPrimitive()) {
/* 678 */       CtPrimitiveType pt = (CtPrimitiveType)type;
/* 679 */       this.exprType = MemberResolver.descToType(pt.getDescriptor());
/* 680 */       this.arrayDim = dim;
/* 681 */       this.className = null;
/*     */     }
/* 683 */     else if (type.isArray()) {
/*     */       try {
View Full Code Here

/*     */   public void doNumCast(CtClass type)
/*     */     throws CompileError
/*     */   {
/* 700 */     if ((this.arrayDim == 0) && (!isRefType(this.exprType)))
/* 701 */       if ((type instanceof CtPrimitiveType)) {
/* 702 */         CtPrimitiveType pt = (CtPrimitiveType)type;
/* 703 */         atNumCastExpr(this.exprType, MemberResolver.descToType(pt.getDescriptor()));
/*     */       }
/*     */       else
/*     */       {
/* 707 */         throw new CompileError("type mismatch");
/*     */       }
View Full Code Here

     */
    public void addReturn(CtClass type) {
        if (type == null)
            addOpcode(RETURN);
        else if (type.isPrimitive()) {
            CtPrimitiveType ptype = (CtPrimitiveType)type;
            addOpcode(ptype.getReturnOp());
        }
        else
            addOpcode(ARETURN);
    }
View Full Code Here

                desc.append(toJvmName(name.substring(0, name.length() - 2)));
                desc.append(';');
            }
        }
        else if (type.isPrimitive()) {
            CtPrimitiveType pt = (CtPrimitiveType)type;
            desc.append(pt.getDescriptor());
        }
        else { // class type
            desc.append('L');
            desc.append(type.getName().replace('.', '/'));
            desc.append(';');
View Full Code Here

               buffer.append('[');
               temp = temp.getComponentType();
            }
            if (temp.isPrimitive())
            {
               CtPrimitiveType primitive = (CtPrimitiveType) temp;
               buffer.append(Character.toString(primitive.getDescriptor()));
            }
            else
            {
               buffer.append('L');
               buffer.append(temp.getName());
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.