类 FrameworkField
- java.lang.Object
- org.junit.runners.model.FrameworkMember<FrameworkField>
- org.junit.runners.model.FrameworkField
- 所有已实现的接口:
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)- 从以下版本开始:
- 4.7
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Object
get(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()
Field
getField()
protected int
getModifiers()
String
getName()
Class<?>
getType()
boolean
isShadowedBy(FrameworkField otherMember)
String
toString()
从类继承的方法 org.junit.runners.model.FrameworkMember
isPublic, isStatic
方法详细资料
getName
public String getName()
- 指定者:
getName
在类中FrameworkMember<FrameworkField>
getAnnotations
public Annotation[] getAnnotations()
从接口复制的说明:Annotatable
Returns the model elements' annotations.
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
从接口复制的说明:Annotatable
Returns the annotation on the model element of the given type, or @code{null}
isShadowedBy
public boolean isShadowedBy(FrameworkField otherMember)
getModifiers
protected int getModifiers()
- 指定者:
getModifiers
在类中FrameworkMember<FrameworkField>
getType
public Class<?> getType()
- 指定者:
getType
在类中FrameworkMember<FrameworkField>
- 返回:
- the underlying Java Field type
- 另请参阅:
Field.getType()
getDeclaringClass
public Class<?> getDeclaringClass()
get
public Object get(Object target) throws IllegalArgumentException, IllegalAccessException
Attempts to retrieve the value of this field ontarget