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 [Field_.java]

nameclass, %method, %block, %line, %
Field_.java100% (1/1)67%  (4/6)74%  (31/42)70%  (7/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Field_100% (1/1)67%  (4/6)74%  (31/42)70%  (7/10)
Field_ (): void 0%   (0/1)0%   (0/3)0%   (0/2)
isAnnotationPresent (Field, Class): boolean 0%   (0/1)0%   (0/8)0%   (0/1)
getAnnotation (Field, Class): Annotation 100% (1/1)100% (10/10)100% (2/2)
getAnnotations (Field): Annotation [] 100% (1/1)100% (3/3)100% (1/1)
getDeclaredAnnotations (Field): Annotation [] 100% (1/1)100% (9/9)100% (2/2)
isSynthetic (Field): 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_SYNTHETIC;
4 
5import java.lang.reflect.Field;
6 
7import net.sourceforge.retroweaver.runtime.java.lang.annotation.AIB;
8import net.sourceforge.retroweaver.runtime.java.lang.annotation.Annotation;
9 
10/**
11 * A mirror of java.lang.reflect.Field.
12 * 
13 * @author Toby Reyelts Date: Feb 21, 2005 Time: 2:29:41 AM
14 */
15public class Field_ {
16 
17        private Field_() {
18                // private constructor
19        }
20 
21        // Returns this element's annotation for the specified type if such an
22        // annotation is present, else null.
23        public static <T extends Annotation> T getAnnotation(final Field f, final Class<T> annotationType) {
24                final Class c = f.getDeclaringClass();
25                return AIB.getAib(c).getFieldAnnotation(f.getName(), annotationType);
26        }
27 
28        // Returns all annotations present on this element.
29        //
30        public static Annotation[] getAnnotations(final Field f) {
31                return getDeclaredAnnotations(f);
32        }
33 
34        // Returns all annotations that are directly present on this element.
35        public static Annotation[] getDeclaredAnnotations(final Field field) {
36                final Class c = field.getDeclaringClass();
37                return AIB.getAib(c).getFieldAnnotations(field.getName());
38        }
39 
40        // Returns true if an annotation for the specified type is present on this
41        // element, else false.
42        public static boolean isAnnotationPresent(final Field field, final Class<? extends Annotation> annotationType) {
43                return getAnnotation(field, annotationType) != null;
44        }
45 
46        // Returns true if this field is a synthetic field; returns false otherwise.
47        public static boolean isSynthetic(final Field f) {
48                final Class c = f.getDeclaringClass();                
49                return ReflectionDescriptor.getReflectionDescriptor(c).testFieldAccess(f, ACC_SYNTHETIC);
50        }
51 
52}

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