Package org.junit.runners.model
Class FrameworkField
- java.lang.Object
- org.junit.runners.model.FrameworkMember<FrameworkField>
- org.junit.runners.model.FrameworkField
- All Implemented Interfaces:
Annotatable
public class FrameworkField extends FrameworkMember<FrameworkField>
Represents a field on a test class (currently used only for Rules inBlockJUnit4ClassRunner, but custom runners can make other uses)- Since:
- 4.7
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(Object target)Attempts to retrieve the value of this field ontarget<T extends Annotation>
TgetAnnotation(Class<T> annotationType)Returns the annotation on the model element of the given type, or @code{null}Annotation[]getAnnotations()Returns the model elements' annotations.Class<?>getDeclaringClass()FieldgetField()protected intgetModifiers()StringgetName()Class<?>getType()booleanisShadowedBy(FrameworkField otherMember)StringtoString()Methods inherited from class org.junit.runners.model.FrameworkMember
isPublic, isStatic
Method Detail
getName
public String getName()
- Specified by:
getNamein classFrameworkMember<FrameworkField>
getAnnotations
public Annotation[] getAnnotations()
Description copied from interface:AnnotatableReturns the model elements' annotations.
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
Description copied from interface:AnnotatableReturns the annotation on the model element of the given type, or @code{null}
isShadowedBy
public boolean isShadowedBy(FrameworkField otherMember)
getModifiers
protected int getModifiers()
- Specified by:
getModifiersin classFrameworkMember<FrameworkField>
getType
public Class<?> getType()
- Specified by:
getTypein classFrameworkMember<FrameworkField>- Returns:
- the underlying Java Field type
- See Also:
Field.getType()
getDeclaringClass
public Class<?> getDeclaringClass()
- Specified by:
getDeclaringClassin classFrameworkMember<FrameworkField>
get
public Object get(Object target) throws IllegalArgumentException, IllegalAccessException
Attempts to retrieve the value of this field ontarget