Coverage Report - org.boretti.drools.integration.drools4.DroolsAddGeneratedSetMethodVisitor
 
Classes in this File Line Coverage Branch Coverage Complexity
DroolsAddGeneratedSetMethodVisitor
0 %
0/10
N/A
1
 
 1  
 /*
 2  
     Drools4 Integration Helper
 3  
     Copyright (C) 2009  Mathieu Boretti mathieu.boretti@gmail.com
 4  
 
 5  
     This program is free software: you can redistribute it and/or modify
 6  
     it under the terms of the GNU General Public License as published by
 7  
     the Free Software Foundation, either version 3 of the License, or
 8  
     (at your option) any later version.
 9  
 
 10  
     This program is distributed in the hope that it will be useful,
 11  
     but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
     GNU General Public License for more details.
 14  
 
 15  
     You should have received a copy of the GNU General Public License
 16  
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 17  
 
 18  
  */
 19  
 package org.boretti.drools.integration.drools4;
 20  
 
 21  
 import org.objectweb.asm.MethodVisitor;
 22  
 import org.objectweb.asm.Opcodes;
 23  
 import org.objectweb.asm.Type;
 24  
 import org.objectweb.asm.commons.AdviceAdapter;
 25  
 
 26  
 /**
 27  
  * @author mbo
 28  
  * @since 1.1.0
 29  
  */
 30  
 class DroolsAddGeneratedSetMethodVisitor extends AdviceAdapter {
 31  
         
 32  
         private String parent;
 33  
         
 34  
         private String droolsName;
 35  
 
 36  
         public DroolsAddGeneratedSetMethodVisitor(MethodVisitor mv, 
 37  
                         int access,
 38  
                         String name, 
 39  
                         String desc,
 40  
                         String parent,
 41  
                         String droolsName) {
 42  0
                 super(mv, access, name, desc);
 43  0
                 this.parent=parent;
 44  0
                 this.droolsName=droolsName;
 45  0
         }
 46  
 
 47  
         /* (non-Javadoc)
 48  
          * @see org.objectweb.asm.commons.AdviceAdapter#onMethodEnter()
 49  
          */
 50  
         @Override
 51  
         protected void onMethodEnter() {
 52  0
                 this.visitVarInsn(Opcodes.ALOAD,0);
 53  0
                 this.visitInsn(Opcodes.ICONST_0);
 54  0
                 this.visitFieldInsn(Opcodes.PUTFIELD,Type.getObjectType(parent).getInternalName(), droolsName, Type.BOOLEAN_TYPE.getDescriptor());
 55  0
         }
 56  
 
 57  
         /* (non-Javadoc)
 58  
          * @see org.objectweb.asm.commons.LocalVariablesSorter#visitMaxs(int, int)
 59  
          */
 60  
         @Override
 61  
         public void visitMaxs(int arg0, int arg1) {
 62  
                 // TODO Auto-generated method stub
 63  0
                 super.visitMaxs(arg0+2, arg1);
 64  0
         }
 65  
 
 66  
 }