org.exolab.javasource

Class JField

Implemented Interfaces:
JMember

public class JField
extends java.lang.Object
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: 1.1.1.1 $ $Date: 2003/03/03 07:09:54 $
Author:
Keith Visco

Constructor Summary

JField(JType type, String name)

Method Summary

JDocComment
getComment()
Returns the comment describing this member.
JClass
getDeclaringClass()
Returns the class in which this JField has been declared
String
getInitString()
Returns the initialization String for this JField
JModifiers
getModifiers()
Returns the modifiers for this JField
String
getName()
Returns the name of this JField
JType
getType()
Returns the JType represting the type of this JField
void
setComment(String comment)
Sets the comment describing this member.
void
setComment(JDocComment comment)
Sets the comment describing this member.
protected void
setDeclaringClass(JClass declaringClass)
void
setInitString(String init)
Sets the initialization string for this JField; Allows some flexibility in declaring default values.
void
setModifiers(JModifiers modifiers)
void
setName(String name)
Sets the name of this JField
String
toString()

Constructor Details

JField

public JField(JType type,
              String name)

Method Details

getComment

public JDocComment getComment()
Returns the comment describing this member.
Returns:
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
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
Specified by:
getModifiers in interface JMember
Returns:
the modifiers for this JField

getName

public String getName()
Returns the name of this JField
Specified by:
getName in interface JMember
Returns:
the name of this JField

getType

public JType getType()
Returns the JType represting the type of this JField
Returns:
the JClass represting the type of this JField

setComment

public void setComment(String comment)
Sets the comment describing this member.
Parameters:
comment - the JDocComment for this member

setComment

public void setComment(JDocComment comment)
Sets the comment describing this member.
Parameters:
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.
Parameters:
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
Parameters:
name - the name of this JField

toString

public String toString()

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