Modifier and Type | Field and Description |
---|---|
private JAnnotations |
annotations |
private JDocComment |
comment |
private JClass |
declaringClass
The Class in this JField has been declared
|
private java.lang.String |
initString |
private JModifiers |
modifiers
The set of modifiers for this JField
|
private java.lang.String |
name |
private JType |
type |
Constructor and Description |
---|
JField(JType type,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
appendAnnotation(java.lang.String annotation) |
JAnnotations |
getAnnotations() |
JDocComment |
getComment()
Returns the comment describing this member.
|
JClass |
getDeclaringClass()
Returns the class in which this JField has been declared
|
java.lang.String |
getInitString()
Returns the initialization String for this JField
|
JModifiers |
getModifiers()
Returns the modifiers for this JField
|
java.lang.String |
getName()
Returns the name of this JField
|
JType |
getType()
Returns the JType represting the type of this JField
|
void |
setAnnotations(JAnnotations annotations) |
void |
setComment(JDocComment comment)
Sets the comment describing this member.
|
void |
setComment(java.lang.String comment)
Sets the comment describing this member.
|
protected void |
setDeclaringClass(JClass declaringClass) |
void |
setInitString(java.lang.String init)
Sets the initialization string for this JField;
Allows some flexibility in declaring default values.
|
void |
setModifiers(JModifiers modifiers) |
void |
setName(java.lang.String name)
Sets the name of this JField
|
java.lang.String |
toString() |
private JModifiers modifiers
private JType type
private java.lang.String name
private JDocComment comment
private java.lang.String initString
private JAnnotations annotations
private JClass declaringClass
public JField(JType type, java.lang.String name)
public JDocComment getComment()
public JClass getDeclaringClass()
public java.lang.String getInitString()
public JModifiers getModifiers()
getModifiers
in interface JMember
public java.lang.String getName()
public JType getType()
public void setComment(JDocComment comment)
comment
- the JDocComment for this memberpublic void setComment(java.lang.String comment)
comment
- the JDocComment for this memberpublic void setInitString(java.lang.String init)
init
- the initialization string for this member.public void setName(java.lang.String name) throws java.lang.IllegalArgumentException
name
- the name of this JFieldjava.lang.IllegalArgumentException
- when the
name is not a valid Java member name, or if a member
with the given name already exists in the declaring classpublic void setModifiers(JModifiers modifiers)
protected void setDeclaringClass(JClass declaringClass)
public java.lang.String toString()
toString
in class java.lang.Object
public JAnnotations getAnnotations()
getAnnotations
in interface JMember
public void appendAnnotation(java.lang.String annotation)
annotation
- the annotation to appendpublic void setAnnotations(JAnnotations annotations)
annotations
- the annotations to set