1 22 package org.jboss.ejb3.metamodel; 23 24 import java.util.ArrayList ; 25 26 31 public class InterceptorBinding extends Method 32 { 33 Boolean ordered = null; 34 private ArrayList <String > interceptorClasses = new ArrayList <String >(); 35 private boolean excludeDefaultInterceptors; 36 private boolean excludeClassInterceptors; 37 38 public InterceptorBinding() 39 { 40 super(); 41 } 42 43 public boolean getExcludeClassInterceptors() 44 { 45 return excludeClassInterceptors; 46 } 47 48 public void setExcludeClassInterceptors(boolean excludeClassInterceptors) 49 { 50 this.excludeClassInterceptors = excludeClassInterceptors; 51 } 52 53 public boolean getExcludeDefaultInterceptors() 54 { 55 return excludeDefaultInterceptors; 56 } 57 58 public void setExcludeDefaultInterceptors(boolean excludeDefaultInterceptors) 59 { 60 this.excludeDefaultInterceptors = excludeDefaultInterceptors; 61 } 62 63 public ArrayList <String > getInterceptorClasses() 64 { 65 return interceptorClasses; 66 } 67 68 public void addInterceptorClass(String interceptorClass) 69 { 70 if (ordered == null) 71 { 72 ordered = false; 73 } 74 if (ordered) throw new RuntimeException ("Cannot have both interceptor-class and interceptor-order in interceptor-binding"); 75 this.interceptorClasses.add(interceptorClass); 76 } 77 78 public void setOrderedInterceptorClasses(InterceptorOrder order) 79 { 80 if (ordered == null) 81 { 82 ordered = true; 83 } 84 if (!ordered) throw new RuntimeException ("Cannot have both interceptor-class and interceptor-order in interceptor-binding"); 85 this.interceptorClasses.addAll(order.getInterceptorClasses()); 86 } 87 88 public boolean isOrdered() 89 { 90 if (ordered == null) return false; 91 return ordered; 92 } 93 94 95 96 } 97 | Popular Tags |