1 29 30 package com.caucho.bytecode; 31 32 35 abstract public class JAnnotationObject { 36 39 public JAnnotation []getDeclaredAnnotations() 40 { 41 return new JAnnotation[0]; 42 } 43 44 47 public JAnnotation getAnnotation(String className) 48 { 49 for (JAnnotation ann : getDeclaredAnnotations()) { 50 if (ann.getType().equals(className)) 51 return ann; 52 } 53 54 return null; 55 } 56 57 60 public JAnnotation getAnnotation(Class cl) 61 { 62 if (cl != null) 63 return getAnnotation(cl.getName()); 64 else 65 return null; 66 } 67 68 71 public boolean isAnnotationPresent(String className) 72 { 73 return getAnnotation(className) != null; 74 } 75 76 79 public boolean isAnnotationPresent(Class cl) 80 { 81 return isAnnotationPresent(cl.getName()); 82 } 83 } 84 | Popular Tags |