org.codehaus.modello.generator.java.javasource
Class JField
java.lang.Object
org.codehaus.modello.generator.java.javasource.JField
- org.codehaus.modello.generator.java.javasource.JMember
public class JField
extends java.lang.Object
implements org.codehaus.modello.generator.java.javasource.JMember
A class which holds information about a field.
Modelled closely after the Java Reflection API.
This class is part of package which is used to
create source code in memory.
$Revision: 149 $ $Date: 2004-09-29 18:32:16 +0100 (Wed, 29 Sep 2004) $
JField
public JField(JType type,
String name)
getComment
public JDocComment getComment()
Returns the comment describing this member.
- the comment describing this member, or
null if no comment has been set.
getDeclaringClass
public JClass getDeclaringClass()
Returns the class in which this JField has been declared
- the class in which this JField has been declared
getInitString
public String getInitString()
Returns the initialization String for this JField
- the initialization String for this JField,
or null if no initialization String was specified.
getModifiers
public JModifiers getModifiers()
Returns the modifiers for this JField
- getModifiers in interface org.codehaus.modello.generator.java.javasource.JMember
- the modifiers for this JField
getName
public String getName()
Returns the name of this JField
- getName in interface org.codehaus.modello.generator.java.javasource.JMember
getType
public JType getType()
Returns the JType represting the type of this JField
- the JClass represting the type of this JField
setComment
public void setComment(String comment)
Sets the comment describing this member.
comment
- the JDocComment for this member
setComment
public void setComment(JDocComment comment)
Sets the comment describing this member.
comment
- the JDocComment for this member
setDeclaringClass
protected void setDeclaringClass(JClass declaringClass)
setInitString
public void setInitString(String init)
Sets the initialization string for this JField;
Allows some flexibility in declaring default values.
init
- the initialization string for this member.
setModifiers
public void setModifiers(JModifiers modifiers)
setName
public void setName(String name)
throws IllegalArgumentException
Sets the name of this JField
name
- the name of this JField
toString
public String toString()