Coverage Report - org.boretti.drools.integration.drools5.annotations.DroolsVariable
 
Classes in this File Line Coverage Branch Coverage Complexity
DroolsVariable
N/A
N/A
0
 
 1  
 /*
 2  
     Drools5 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.drools5.annotations;
 20  
 
 21  
 import static java.lang.annotation.ElementType.METHOD;
 22  
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 23  
 
 24  
 import java.lang.annotation.Retention;
 25  
 import java.lang.annotation.Target;
 26  
 
 27  
 
 28  
 /**
 29  
  * This annotation defines a method that is used as a Drools Variable.
 30  
  * 
 31  
  * This must be use on a method of an interface annotated with @DroolsService.
 32  
  * 
 33  
  * Only setter method setXXX with one parameter and return type void can be annotated with this
 34  
  * Annotation.
 35  
  * 
 36  
  * This type of method are used to inject fact (when global = false) or global (global = true) 
 37  
  * into drools. The injection of the field is only done at start of a session (stateless or 
 38  
  * statefull).
 39  
  * 
 40  
  * @author mbo
 41  
  *
 42  
  */
 43  
 @Retention(RUNTIME)
 44  
 @Target(METHOD)
 45  
 public @interface DroolsVariable {
 46  
         /**
 47  
          * This is the fact this variable is global. 
 48  
          * 
 49  
          * By default it is false.
 50  
          * 
 51  
          * When global is true, the variable is asserted as global. When not global, the
 52  
          * variable is asserted as "normal" variable.
 53  
          */
 54  
         boolean global() default false;
 55  
 }