Package net.sf.cglib.core

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


/* 39 */         indexes.add(new Integer(index));
/* 40 */         CodeEmitter e = context.beginMethod(ce, method);
/* 41 */         e.load_this();
/* 42 */         e.dup();
/* 43 */         e.invoke_virtual_this(loadMethod(index));
/* 44 */         e.checkcast(method.getClassInfo().getType());
/* 45 */         e.load_args();
/* 46 */         e.invoke(method);
/* 47 */         e.return_value();
/* 48 */         e.end_method();
/*    */       }
View Full Code Here


/*     */   }
/*     */
/*     */   private void generatePut(Class type, Map setters) {
/* 123 */     CodeEmitter e = begin_method(1, BEAN_MAP_PUT, null, null);
/* 124 */     e.load_arg(0);
/* 125 */     e.checkcast(Type.getType(type));
/* 126 */     e.load_arg(1);
/* 127 */     e.checkcast(Constants.TYPE_STRING);
/* 128 */     EmitUtils.string_switch(e, getNames(setters), 1, new ObjectSwitchCallback(setters, e) {
/*     */       public void processCase(Object key, Label end) {
/* 130 */         PropertyDescriptor pd = (PropertyDescriptor)this.val$setters.get(key);
View Full Code Here

/*     */   private void generatePut(Class type, Map setters) {
/* 123 */     CodeEmitter e = begin_method(1, BEAN_MAP_PUT, null, null);
/* 124 */     e.load_arg(0);
/* 125 */     e.checkcast(Type.getType(type));
/* 126 */     e.load_arg(1);
/* 127 */     e.checkcast(Constants.TYPE_STRING);
/* 128 */     EmitUtils.string_switch(e, getNames(setters), 1, new ObjectSwitchCallback(setters, e) {
/*     */       public void processCase(Object key, Label end) {
/* 130 */         PropertyDescriptor pd = (PropertyDescriptor)this.val$setters.get(key);
/* 131 */         if (pd.getReadMethod() == null) {
/* 132 */           this.val$e.aconst_null();
View Full Code Here

/*  81 */       CodeEmitter e = ce.begin_method(1, ImmutableBean.CSTRUCT_OBJECT, null, null);
/*  82 */       e.load_this();
/*  83 */       e.super_invoke_constructor();
/*  84 */       e.load_this();
/*  85 */       e.load_arg(0);
/*  86 */       e.checkcast(targetType);
/*  87 */       e.putfield("CGLIB$RWBean");
/*  88 */       e.return_value();
/*  89 */       e.end_method();
/*     */
/*  91 */       PropertyDescriptor[] descriptors = ReflectUtils.getBeanProperties(this.target);
View Full Code Here

/*     */
/*     */   private void generateGet(Class target, Method[] getters) {
/*  58 */     CodeEmitter e = begin_method(1, GET_PROPERTY_VALUES, null, null);
/*  59 */     if (getters.length >= 0) {
/*  60 */       e.load_arg(0);
/*  61 */       e.checkcast(Type.getType(target));
/*  62 */       Local bean = e.make_local();
/*  63 */       e.store_local(bean);
/*  64 */       for (int i = 0; i < getters.length; i++) {
/*  65 */         if (getters[i] != null) {
/*  66 */           MethodInfo getter = ReflectUtils.getMethodInfo(getters[i]);
View Full Code Here

/*  771 */     e.load_this();
/*  772 */     e.load_arg(0);
/*  773 */     for (int i = 0; i < this.callbackTypes.length; i++) {
/*  774 */       e.dup2();
/*  775 */       e.aaload(i);
/*  776 */       e.checkcast(this.callbackTypes[i]);
/*  777 */       e.putfield(getCallbackField(i));
/*      */     }
/*  779 */     e.return_value();
/*  780 */     e.end_method();
/*      */   }
View Full Code Here

/* 65 */           MethodInfo method = ReflectUtils.getMethodInfo(methods[j]);
/* 66 */           e = EmitUtils.begin_method(this, method, 1);
/* 67 */           e.load_this();
/* 68 */           e.getfield("CGLIB$DELEGATES");
/* 69 */           e.aaload(route != null ? route[i] : i);
/* 70 */           e.checkcast(method.getClassInfo().getType());
/* 71 */           e.load_args();
/* 72 */           e.invoke(method);
/* 73 */           e.return_value();
/* 74 */           e.end_method();
/*    */         }
View Full Code Here

/* 50 */           e.load_this();
/* 51 */           e.invoke_interface(PROXY_REF_DISPATCHER, PROXY_REF_LOAD_OBJECT);
/*    */         } else {
/* 53 */           e.invoke_interface(DISPATCHER, LOAD_OBJECT);
/*    */         }
/* 55 */         e.checkcast(method.getClassInfo().getType());
/* 56 */         e.load_args();
/* 57 */         e.invoke(method);
/* 58 */         e.return_value();
/* 59 */         e.end_method();
/*    */       }
View Full Code Here

/* 117 */       e.end_method();
/*     */
/* 120 */       e = ce.begin_method(1, ADD_DELEGATE, null, null);
/* 121 */       e.load_this();
/* 122 */       e.load_arg(0);
/* 123 */       e.checkcast(Type.getType(this.iface));
/* 124 */       e.invoke_virtual_this(ADD_HELPER);
/* 125 */       e.return_value();
/* 126 */       e.end_method();
/*     */
/* 128 */       ce.end_class();
View Full Code Here

/*  82 */     EmitUtils.constructor_switch(e, info, new GetIndexCallback(e, info));
/*  83 */     e.end_method();
/*     */
/*  86 */     e = begin_method(1, INVOKE, INVOCATION_TARGET_EXCEPTION_ARRAY, null);
/*  87 */     e.load_arg(1);
/*  88 */     e.checkcast(Type.getType(type));
/*  89 */     e.load_arg(0);
/*  90 */     invokeSwitchHelper(e, methods, 2);
/*  91 */     e.end_method();
/*     */
/*  94 */     e = begin_method(1, NEW_INSTANCE, INVOCATION_TARGET_EXCEPTION_ARRAY, 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.