Package net.sf.cglib.core

Examples of net.sf.cglib.core.MethodInfo


/*      */   }
/*      */
/*      */   private void emitConstructors(ClassEmitter ce, List constructors) {
/*  698 */     boolean seenNull = false;
/*  699 */     for (Iterator it = constructors.iterator(); it.hasNext(); ) {
/*  700 */       MethodInfo constructor = (MethodInfo)it.next();
/*  701 */       CodeEmitter e = EmitUtils.begin_method(ce, constructor, 1);
/*  702 */       e.load_this();
/*  703 */       e.dup();
/*  704 */       e.load_args();
/*  705 */       Signature sig = constructor.getSignature();
/*  706 */       seenNull = (seenNull) || (sig.getDescriptor().equals("()V"));
/*  707 */       e.super_invoke_constructor(sig);
/*  708 */       e.invoke_static_this(BIND_CALLBACKS);
/*  709 */       if (!this.interceptDuringConstruction) {
/*  710 */         e.load_this();
View Full Code Here


/*  844 */     e.new_instance_this();
/*  845 */     e.dup();
/*  846 */     e.load_arg(0);
/*  847 */     EmitUtils.constructor_switch(e, constructors, new ObjectSwitchCallback(e) {
/*      */       public void processCase(Object key, Label end) {
/*  849 */         MethodInfo constructor = (MethodInfo)key;
/*  850 */         Type[] types = constructor.getSignature().getArgumentTypes();
/*  851 */         for (int i = 0; i < types.length; i++) {
/*  852 */           this.val$e.load_arg(1);
/*  853 */           this.val$e.push(i);
/*  854 */           this.val$e.aaload();
/*  855 */           this.val$e.unbox(types[i]);
/*      */         }
/*  857 */         this.val$e.invoke_constructor_this(constructor.getSignature());
/*  858 */         this.val$e.goTo(end);
/*      */       }
/*      */       public void processDefault() {
/*  861 */         this.val$e.throw_exception(Enhancer.ILLEGAL_ARGUMENT_EXCEPTION, "Constructor not found");
/*      */       }
View Full Code Here

/*      */
/*  878 */     Iterator it1 = methods.iterator();
/*  879 */     Iterator it2 = actualMethods != null ? actualMethods.iterator() : null;
/*      */
/*  881 */     while (it1.hasNext()) {
/*  882 */       MethodInfo method = (MethodInfo)it1.next();
/*  883 */       Method actualMethod = it2 != null ? (Method)it2.next() : null;
/*  884 */       int index = this.filter.accept(actualMethod);
/*  885 */       if (index >= this.callbackTypes.length) {
/*  886 */         throw new IllegalArgumentException("Callback filter returned an index that is too large: " + index);
/*      */       }
/*  888 */       originalModifiers.put(method, new Integer(actualMethod != null ? actualMethod.getModifiers() : method.getModifiers()));
/*  889 */       indexes.put(method, new Integer(index));
/*  890 */       List group = (List)groups.get(generators[index]);
/*  891 */       if (group == null) {
/*  892 */         groups.put(generators[index], group = new ArrayList(methods.size()));
/*      */       }
/*  894 */       group.add(method);
/*      */     }
/*      */
/*  897 */     Set seenGen = new HashSet();
/*  898 */     CodeEmitter se = ce.getStaticHook();
/*  899 */     se.new_instance(THREAD_LOCAL);
/*  900 */     se.dup();
/*  901 */     se.invoke_constructor(THREAD_LOCAL, CSTRUCT_NULL);
/*  902 */     se.putfield("CGLIB$THREAD_CALLBACKS");
/*      */
/*  904 */     Object[] state = new Object[1];
/*  905 */     CallbackGenerator.Context context = new CallbackGenerator.Context(originalModifiers, indexes, positions) {
/*      */       public int getOriginalModifiers(MethodInfo method) {
/*  907 */         return ((Integer)this.val$originalModifiers.get(method)).intValue();
/*      */       }
/*      */       public int getIndex(MethodInfo method) {
/*  910 */         return ((Integer)this.val$indexes.get(method)).intValue();
/*      */       }
/*      */       public void emitCallback(CodeEmitter e, int index) {
/*  913 */         Enhancer.this.emitCurrentCallback(e, index);
/*      */       }
/*      */       public Signature getImplSignature(MethodInfo method) {
/*  916 */         return Enhancer.this.rename(method.getSignature(), ((Integer)this.val$positions.get(method)).intValue());
/*      */       }
/*      */       public CodeEmitter beginMethod(ClassEmitter ce, MethodInfo method) {
/*  919 */         CodeEmitter e = EmitUtils.begin_method(ce, method);
/*  920 */         if ((!Enhancer.this.interceptDuringConstruction) && (!TypeUtils.isAbstract(method.getModifiers())))
/*      */         {
/*  922 */           Label constructed = e.make_label();
/*  923 */           e.load_this();
/*  924 */           e.getfield("CGLIB$CONSTRUCTED");
/*  925 */           e.if_jump(154, constructed);
View Full Code Here

TOP

Related Classes of net.sf.cglib.core.MethodInfo

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.