package bluej.views;
import threadchecker.OnThread;
import threadchecker.Tag;
import java.lang.reflect.*;
| @version $Id: FieldView.java 15114 2015-12-02 22:08:41Z mik $
| @author Michael Cahill
|
| A representation of a Java field in BlueJ
|
public final class FieldView
extends MemberView{
@OnThread(Tag.Any)
private final Field field;
private View type;
| Constructor.
|
public FieldView(View view, Field field)
{
super(view);
this.field = field;
}
| Returns the Field being manipulated by this View.
|
| @return the Field that this view represent.
|
public Field getField()
{
return field;
}
| Returns the name of this method as a String
|
public String getName()
{
return field.getName();
}
| Returns a Class object that represents the type of the field represented
| by this object.
|
public View getType()
{
if (type == null)
type = View.getView(field.getType());
return type;
}
| Returns a string describing this Method.
|
public String toString()
{
return field.toString();
}
@OnThread(Tag.Any)
public int getModifiers()
{
return field.getModifiers();
}
public String getShortDesc()
{
StringBuffer sb = new StringBuffer();
sb.append(View.getTypeName(field.getType()));
sb.append(" ");
sb.append(field.getName());
return sb.toString();
}
public String getLongDesc()
{
return getShortDesc();
}
| Returns a string describing this Field in a human-readable format
|
public String getSignature()
{
StringBuffer sb = new StringBuffer();
sb.append(field.getName());
return sb.toString();
}
}
. - FieldView
. FieldView
. getField
. getName
. getType
. toString
. getModifiers
. getShortDesc
. getLongDesc
. getSignature
94 neLoCode
+ 11 LoComm