org.exolab.javasource
Class JField

java.lang.Object
  extended by org.exolab.javasource.JAnnotatedElementHelper
      extended by org.exolab.javasource.JField
All Implemented Interfaces:
JAnnotatedElement, JMember

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: 6674 $ $Date: 2005-02-26 17:30:28 -0700 (Sat, 26 Feb 2005) $
Author:
Keith Visco

Constructor Summary
JField(JType type, java.lang.String name)
          Creates a new JField.
 
Method Summary
 JDocComment getComment()
          Returns the JavaDoc 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 representing the type of this JField.
 boolean isDateTime()
          Indicates whether this JField instance represents a field of type date/time.
 void setComment(JDocComment comment)
          Sets the JavaDoc comment describing this JField.
 void setComment(java.lang.String comment)
          Sets the JavaDoc comment describing this JField.
 void setDateTime(boolean isDateTime)
          To indicate whether this JField instance represents a field of type date/time.
protected  void setDeclaringClass(JClass declaringClass)
          Sets the class that declares this JField.
 void setInitString(java.lang.String init)
          Sets the initialization string for this JField.
 void setModifiers(JModifiers modifiers)
          Sets the access modifiers on this JField.
 void setName(java.lang.String name)
          Sets the name of this JField.
 java.lang.String toString()
          
 
Methods inherited from class org.exolab.javasource.JAnnotatedElementHelper
addAnnotation, getAnnotation, getAnnotations, hasAnnotations, isAnnotationPresent, printAnnotations, removeAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JField

public JField(JType type,
              java.lang.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 java.lang.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 java.lang.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 representing the type of this JField.

Returns:
The JType representing the type of this JField.

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(java.lang.String comment)
Sets the JavaDoc comment describing this JField.

Parameters:
comment - The JavaDoc comment for this JField.

setInitString

public void setInitString(java.lang.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.

setName

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

Parameters:
name - The name of this JField.

setModifiers

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

Parameters:
modifiers - The access modifiers to be used for this JField.

setDeclaringClass

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

Parameters:
declaringClass - The class in which this Jfield is declared.

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.

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.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


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