EMMA Coverage Report (generated Sat Feb 02 18:43:55 MSK 2008)
[all classes][net.sourceforge.retroweaver.runtime.java.lang.reflect]

COVERAGE SUMMARY FOR SOURCE FILE [Method_.java]

nameclass, %method, %block, %line, %
Method_.java100% (1/1)80%  (8/10)88%  (84/95)85%  (17/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Method_100% (1/1)80%  (8/10)88%  (84/95)85%  (17/20)
Method_ (): void 0%   (0/1)0%   (0/3)0%   (0/2)
isAnnotationPresent (Method, Class): boolean 0%   (0/1)0%   (0/8)0%   (0/1)
getAnnotation (Method, Class): Annotation 100% (1/1)100% (14/14)100% (2/2)
getAnnotations (Method): Annotation [] 100% (1/1)100% (3/3)100% (1/1)
getDeclaredAnnotations (Method): Annotation [] 100% (1/1)100% (13/13)100% (2/2)
getDefaultValue (Method): Object 100% (1/1)100% (14/14)100% (4/4)
getParameterAnnotations (Method): Annotation [][] 100% (1/1)100% (13/13)100% (2/2)
isBridge (Method): boolean 100% (1/1)100% (9/9)100% (2/2)
isSynthetic (Method): boolean 100% (1/1)100% (9/9)100% (2/2)
isVarArgs (Method): boolean 100% (1/1)100% (9/9)100% (2/2)

1package net.sourceforge.retroweaver.runtime.java.lang.reflect;
2 
3import static org.objectweb.asm.Opcodes.ACC_BRIDGE;
4import static org.objectweb.asm.Opcodes.ACC_SYNTHETIC;
5import static org.objectweb.asm.Opcodes.ACC_VARARGS;
6 
7import java.lang.reflect.Method;
8 
9import net.sourceforge.retroweaver.runtime.java.lang.annotation.AIB;
10import net.sourceforge.retroweaver.runtime.java.lang.annotation.Annotation;
11 
12/**
13 * A mirror of java.lang.reflect.Method.
14 * 
15 * @author Toby Reyelts Date: Feb 20, 2005 Time: 11:10:46 PM
16 */
17public class Method_ {
18 
19        private Method_() {
20                // private constructor
21        }
22 
23        // Returns the default value for the annotation member represented by this
24        // <tt>Method</tt> instance.
25        public static Object getDefaultValue(final Method m) {
26                final Class c = m.getDeclaringClass();
27 
28                if (!c.isAnnotation()) {
29                        return null;
30                }
31 
32                return AIB.getAib(c).getDefaultValue(m.getName());
33        }
34 
35        // Returns this element's annotation for the specified type if such an
36        // annotation is present, else null.
37        public static <T extends Annotation> T getAnnotation(final Method m, final Class<T> annotationType) {
38                final Class c = m.getDeclaringClass();
39                return AIB.getAib(c).getMethodAnnotation(m.getName(), m.getParameterTypes(), m.getReturnType(), annotationType);
40        }
41 
42        // Returns all annotations present on this element.
43        public static Annotation[] getAnnotations(final Method m) {
44                return getDeclaredAnnotations(m);
45        }
46 
47        // Returns all annotations that are directly present on this element.
48        public static Annotation[] getDeclaredAnnotations(final Method m) {
49                final Class c = m.getDeclaringClass();
50                return AIB.getAib(c).getMethodAnnotations(m.getName(), m.getParameterTypes(), m.getReturnType());
51        }
52 
53        // Returns true if an annotation for the specified type is present on this
54        // element, else false.
55        public static boolean isAnnotationPresent(final Method m, final Class<? extends Annotation> annotationType) {
56                return getAnnotation(m, annotationType) != null;
57        }
58 
59        public static Annotation[][] getParameterAnnotations(final Method m) {
60                final Class c = m.getDeclaringClass();
61                return AIB.getAib(c).getMethodParameterAnnotations(m.getName(), m.getParameterTypes(), m.getReturnType());
62        }
63 
64        // Returns true if this method is a bridge method; returns false otherwise.
65        public static boolean isBridge(final Method m) {
66                final Class c = m.getDeclaringClass();
67                return ReflectionDescriptor.getReflectionDescriptor(c).testMethodAccess(m, ACC_BRIDGE);
68        }
69 
70        // Returns true if this method was declared to take a variable number of arguments; returns false otherwise.
71        public static boolean isVarArgs(final Method m) {
72                final Class c = m.getDeclaringClass();
73                return ReflectionDescriptor.getReflectionDescriptor(c).testMethodAccess(m, ACC_VARARGS);
74        }
75 
76        // Returns true if this method is a synthetic method; returns false otherwise.
77        public static boolean isSynthetic(final Method m) {
78                final Class c = m.getDeclaringClass();
79                return ReflectionDescriptor.getReflectionDescriptor(c).testMethodAccess(m, ACC_SYNTHETIC);
80        }
81 
82}

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