Package net.sf.cglib.core

Examples of net.sf.cglib.core.CodeEmitter.checkcast()


/* 57 */       declare_field(2, getFieldName(i), type, null, null);
/* 58 */       e.load_this();
/* 59 */       e.load_arg(0);
/* 60 */       e.push(i);
/* 61 */       e.aaload();
/* 62 */       e.checkcast(type);
/* 63 */       e.putfield(getFieldName(i));
/*    */     }
/* 65 */     e.return_value();
/* 66 */     e.end_method();
/*    */   }
View Full Code Here


/* 105 */     e.load_this();
/* 106 */     e.push(name);
/* 107 */     e.load_local(result);
/* 108 */     e.invoke_interface(CALLBACK, readCallbackSig(type));
/* 109 */     if (!TypeUtils.isPrimitive(type)) {
/* 110 */       e.checkcast(type);
/*     */     }
/* 112 */     e.return_value();
/* 113 */     e.end_method();
/*     */   }
/*     */
View Full Code Here

/* 131 */     e.load_this();
/* 132 */     e.getfield(name);
/* 133 */     e.load_arg(0);
/* 134 */     e.invoke_interface(CALLBACK, writeCallbackSig(type));
/* 135 */     if (!TypeUtils.isPrimitive(type)) {
/* 136 */       e.checkcast(type);
/*     */     }
/* 138 */     Label go = e.make_label();
/* 139 */     e.goTo(go);
/* 140 */     e.mark(skip);
/* 141 */     e.load_arg(0);
View Full Code Here

/*     */   }
/*     */
/*     */   private void generateGet(Class type, Map getters) {
/* 101 */     CodeEmitter e = begin_method(1, BEAN_MAP_GET, null, null);
/* 102 */     e.load_arg(0);
/* 103 */     e.checkcast(Type.getType(type));
/* 104 */     e.load_arg(1);
/* 105 */     e.checkcast(Constants.TYPE_STRING);
/* 106 */     EmitUtils.string_switch(e, getNames(getters), 1, new ObjectSwitchCallback(getters, e) {
/*     */       public void processCase(Object key, Label end) {
/* 108 */         PropertyDescriptor pd = (PropertyDescriptor)this.val$getters.get(key);
View Full Code Here

/*     */   private void generateGet(Class type, Map getters) {
/* 101 */     CodeEmitter e = begin_method(1, BEAN_MAP_GET, null, null);
/* 102 */     e.load_arg(0);
/* 103 */     e.checkcast(Type.getType(type));
/* 104 */     e.load_arg(1);
/* 105 */     e.checkcast(Constants.TYPE_STRING);
/* 106 */     EmitUtils.string_switch(e, getNames(getters), 1, new ObjectSwitchCallback(getters, e) {
/*     */       public void processCase(Object key, Label end) {
/* 108 */         PropertyDescriptor pd = (PropertyDescriptor)this.val$getters.get(key);
/* 109 */         MethodInfo method = ReflectUtils.getMethodInfo(pd.getReadMethod());
/* 110 */         this.val$e.invoke(method);
View Full Code Here

/*     */       }
/* 113 */       Local targetLocal = e.make_local();
/* 114 */       Local sourceLocal = e.make_local();
/* 115 */       if (this.useConverter) {
/* 116 */         e.load_arg(1);
/* 117 */         e.checkcast(targetType);
/* 118 */         e.store_local(targetLocal);
/* 119 */         e.load_arg(0);
/* 120 */         e.checkcast(sourceType);
/* 121 */         e.store_local(sourceLocal);
/*     */       } else {
View Full Code Here

/* 115 */       if (this.useConverter) {
/* 116 */         e.load_arg(1);
/* 117 */         e.checkcast(targetType);
/* 118 */         e.store_local(targetLocal);
/* 119 */         e.load_arg(0);
/* 120 */         e.checkcast(sourceType);
/* 121 */         e.store_local(sourceLocal);
/*     */       } else {
/* 123 */         e.load_arg(1);
/* 124 */         e.checkcast(targetType);
/* 125 */         e.load_arg(0);
View Full Code Here

/* 119 */         e.load_arg(0);
/* 120 */         e.checkcast(sourceType);
/* 121 */         e.store_local(sourceLocal);
/*     */       } else {
/* 123 */         e.load_arg(1);
/* 124 */         e.checkcast(targetType);
/* 125 */         e.load_arg(0);
/* 126 */         e.checkcast(sourceType);
/*     */       }
/* 128 */       for (int i = 0; i < setters.length; i++) {
/* 129 */         PropertyDescriptor setter = setters[i];
View Full Code Here

/* 121 */         e.store_local(sourceLocal);
/*     */       } else {
/* 123 */         e.load_arg(1);
/* 124 */         e.checkcast(targetType);
/* 125 */         e.load_arg(0);
/* 126 */         e.checkcast(sourceType);
/*     */       }
/* 128 */       for (int i = 0; i < setters.length; i++) {
/* 129 */         PropertyDescriptor setter = setters[i];
/* 130 */         PropertyDescriptor getter = (PropertyDescriptor)names.get(setter.getName());
/* 131 */         if (getter != null) {
View Full Code Here

/*  83 */     if (setters.length > 0) {
/*  84 */       Local index = e.make_local(Type.INT_TYPE);
/*  85 */       e.push(0);
/*  86 */       e.store_local(index);
/*  87 */       e.load_arg(0);
/*  88 */       e.checkcast(Type.getType(target));
/*  89 */       e.load_arg(1);
/*  90 */       Block handler = e.begin_block();
/*  91 */       int lastIndex = 0;
/*  92 */       for (int i = 0; i < setters.length; i++) {
/*  93 */         if (setters[i] != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.