org.exolab.javasource

Class JField

public final class JField extends JAnnotatedElementHelper implements 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.

Version: $Revision: 6324 $ $Date: 2005-02-26 17:30:28 -0700 (Sat, 26 Feb 2005) $

Author: Keith Visco

Constructor Summary
JField(JType type, String name)
Creates a new JField.
Method Summary
JDocCommentgetComment()
Returns the JavaDoc comment describing this member.
JClassgetDeclaringClass()
Returns the class in which this JField has been declared.
StringgetInitString()
Returns the initialization String for this JField.
JModifiersgetModifiers()
Returns the modifiers for this JField.
StringgetName()
Returns the name of this JField.
JTypegetType()
Returns the JType representing the type of this JField.
booleanisDateTime()
Indicates whether this JField instance represents a field of type date/time.
voidsetComment(JDocComment comment)
Sets the JavaDoc comment describing this JField.
voidsetComment(String comment)
Sets the JavaDoc comment describing this JField.
voidsetDateTime(boolean isDateTime)
To indicate whether this JField instance represents a field of type date/time.
protected voidsetDeclaringClass(JClass declaringClass)
Sets the class that declares this JField.
voidsetInitString(String init)
Sets the initialization string for this JField.
voidsetModifiers(JModifiers modifiers)
Sets the access modifiers on this JField.
voidsetName(String name)
Sets the name of this JField.
StringtoString()

Constructor Detail

JField

public JField(JType type, String name)
Creates a new JField.

Parameters: type JType of this new field name name of this new field

Method Detail

getComment

public JDocComment getComment()
Returns the JavaDoc comment describing this member.

Returns: the JavaDoc 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.

Returns: the class in which this JField has been declared.

getInitString

public String getInitString()
Returns the initialization String for this JField.

Returns: the initialization String for this JField, or null if no initialization String was specified.

getModifiers

public JModifiers getModifiers()
Returns the modifiers for this JField.

Returns: the modifiers for this JField.

getName

public String getName()
Returns the name of this JField.

Returns: the name of this JField.

getType

public JType getType()
Returns the JType representing the type of this JField.

Returns: the JType representing the type of this JField.

isDateTime

public boolean isDateTime()
Indicates whether this JField instance represents a field of type date/time.

Returns: True if this field is of type date/time.

setComment

public void setComment(JDocComment comment)
Sets the JavaDoc comment describing this JField.

Parameters: comment the JavaDoc comment for this JField

setComment

public void setComment(String comment)
Sets the JavaDoc comment describing this JField.

Parameters: comment the JavaDoc comment for this JField

setDateTime

public void setDateTime(boolean isDateTime)
To indicate whether this JField instance represents a field of type date/time.

Parameters: isDateTime True if this field is of type date/time.

setDeclaringClass

protected void setDeclaringClass(JClass declaringClass)
Sets the class that declares this JField.

Parameters: declaringClass the class in which this Jfield is declared

setInitString

public void setInitString(String init)
Sets the initialization string for this JField. This allows some flexibility in declaring default values.

Parameters: init the initialization string for this member

setModifiers

public void setModifiers(JModifiers modifiers)
Sets the access modifiers on this JField.

Parameters: modifiers the access modifiers to be used for this JField

setName

public void setName(String name)
Sets the name of this JField.

Parameters: name the name of this JField

toString

public String toString()

See Also: java.lang.Object#toString() {@inheritDoc }

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com