1 22 package org.jboss.ejb; 23 24 import java.util.ArrayList ; 25 import java.util.List ; 26 27 33 public class InterceptorsImpl implements javax.interceptor.Interceptors 34 { 35 private List values = new ArrayList (); 36 37 public InterceptorsImpl() 38 { 39 } 40 41 public Class [] value() 42 { 43 Class [] result = new Class [values.size()]; 44 values.toArray(result); 45 return result; 46 } 47 48 public void addValue(Class value) 49 { 50 values.add(value); 51 } 52 53 public static InterceptorsImpl getImpl(javax.interceptor.Interceptors interceptors) 54 { 55 if (interceptors == null) 56 { 57 return new InterceptorsImpl(); 58 } 59 60 if (interceptors instanceof InterceptorsImpl) 61 { 62 return (InterceptorsImpl)interceptors; 63 } 64 65 InterceptorsImpl impl = new InterceptorsImpl(); 66 67 for (Class clazz : interceptors.value()) 68 { 69 impl.addValue(clazz); 70 } 71 return impl; 72 } 73 74 public Class annotationType() 75 { 76 return javax.interceptor.Interceptors.class; 77 } 78 } 79 | Popular Tags |