org.junit.runners.model
Class FrameworkField

java.lang.Object
  extended by org.junit.runners.model.FrameworkMember<FrameworkField>
      extended by org.junit.runners.model.FrameworkField

public class FrameworkField
extends FrameworkMember<FrameworkField>

Represents a field on a test class (currently used only for Rules in BlockJUnit4ClassRunner, but custom runners can make other uses)

Since:
4.7

Method Summary
 Object get(Object target)
          Attempts to retrieve the value of this field on target
 Annotation[] getAnnotations()
          Returns the annotations on this method
 Field getField()
           
 String getName()
           
 Class<?> getType()
           
 boolean isPublic()
           
 boolean isShadowedBy(FrameworkField otherMember)
           
 boolean isStatic()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public String getName()
Specified by:
getName in class FrameworkMember<FrameworkField>

getAnnotations

public Annotation[] getAnnotations()
Description copied from class: FrameworkMember
Returns the annotations on this method


isPublic

public boolean isPublic()
Specified by:
isPublic in class FrameworkMember<FrameworkField>

isShadowedBy

public boolean isShadowedBy(FrameworkField otherMember)

isStatic

public boolean isStatic()
Specified by:
isStatic in class FrameworkMember<FrameworkField>

getField

public Field getField()
Returns:
the underlying java Field

getType

public Class<?> getType()
Specified by:
getType in class FrameworkMember<FrameworkField>
Returns:
the underlying Java Field type
See Also:
Field.getType()

get

public Object get(Object target)
           throws IllegalArgumentException,
                  IllegalAccessException
Attempts to retrieve the value of this field on target

Throws:
IllegalArgumentException
IllegalAccessException