EMMA Coverage Report (generated Mon Nov 26 19:18:24 CET 2007)
[all classes][net.sourceforge.retroweaver.runtime.java.lang.reflect]

COVERAGE SUMMARY FOR SOURCE FILE [AccessibleObject_.java]

nameclass, %method, %block, %line, %
AccessibleObject_.java0%   (0/1)0%   (0/5)0%   (0/114)0%   (0/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AccessibleObject_0%   (0/1)0%   (0/5)0%   (0/114)0%   (0/24)
AccessibleObject_ (): void 0%   (0/1)0%   (0/3)0%   (0/2)
getAnnotation (AccessibleObject, Class): Annotation 0%   (0/1)0%   (0/37)0%   (0/7)
getAnnotations (AccessibleObject): Annotation [] 0%   (0/1)0%   (0/3)0%   (0/1)
getDeclaredAnnotations (AccessibleObject): Annotation [] 0%   (0/1)0%   (0/34)0%   (0/7)
isAnnotationPresent (AccessibleObject, Class): boolean 0%   (0/1)0%   (0/37)0%   (0/7)

1 
2package net.sourceforge.retroweaver.runtime.java.lang.reflect;
3 
4import net.sourceforge.retroweaver.runtime.java.lang.annotation.Annotation;
5import java.lang.reflect.*;
6 
7/**
8 * @author Toby Reyelts
9 *         Date: Feb 21, 2005
10 *         Time: 10:30:37 PM
11 */
12public class AccessibleObject_ {
13 
14  private AccessibleObject_() {
15          // private constructor
16  }
17 
18  public static <T extends Annotation> T getAnnotation(final AccessibleObject obj, final Class<T> annotationClass) {
19    if ( obj instanceof Constructor ) {
20      return Constructor_.getAnnotation( ( Constructor ) obj, annotationClass );
21    }
22    else if ( obj instanceof Method ) {
23      return Method_.getAnnotation( ( Method ) obj, annotationClass );
24    }
25    else if ( obj instanceof Field ) {
26      return Field_.getAnnotation( ( Field ) obj, annotationClass );
27    }
28    else {
29      throw new UnsupportedOperationException( "Unexpected AccessibleObject type: " + obj.getClass() );
30    }
31  }
32 
33  public static Annotation[] getAnnotations(final AccessibleObject obj) {
34    return getDeclaredAnnotations( obj );
35  }
36 
37  public static Annotation[] getDeclaredAnnotations(final AccessibleObject obj) {
38    if ( obj instanceof Constructor ) {
39      return Constructor_.getDeclaredAnnotations( ( Constructor ) obj );
40    }
41    else if ( obj instanceof Method ) {
42      return Method_.getDeclaredAnnotations( ( Method ) obj );
43    }
44    else if ( obj instanceof Field ) {
45      return Field_.getDeclaredAnnotations( ( Field ) obj );
46    }
47    else {
48      throw new UnsupportedOperationException( "Unexpected AccessibleObject type: " + obj.getClass() );
49    }
50  }
51 
52   public static boolean isAnnotationPresent(final AccessibleObject obj, final Class<? extends Annotation> annotationClass) {
53     if ( obj instanceof Constructor ) {
54       return Constructor_.isAnnotationPresent( ( Constructor ) obj, annotationClass );
55     }
56     else if ( obj instanceof Method ) {
57       return Method_.isAnnotationPresent( ( Method ) obj, annotationClass );
58     }
59     else if ( obj instanceof Field ) {
60       return Field_.isAnnotationPresent( ( Field ) obj, annotationClass );
61     }
62     else {
63       throw new UnsupportedOperationException( "Unexpected AccessibleObject type: " + obj.getClass() );
64     }
65   }
66 
67}
68 

[all classes][net.sourceforge.retroweaver.runtime.java.lang.reflect]
EMMA 2.0.7906 (unsupported private build) (C) Vladimir Roubtsov