org.sourceforge.ifx.tools
Class JavaSource

java.lang.Object
  extended byorg.sourceforge.ifx.tools.JavaSource

public class JavaSource
extends java.lang.Object

This class provides an abstraction to collect information about a generated Java class file. Its toString() method will produce a String that can be written using a Writer object to persistent store.

Version:
$Revision: 1.5 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Constructor Summary
JavaSource()
           
 
Method Summary
 void addMemberVariable(java.lang.String mVarClass, boolean isArray)
          Adds a new member variable object for the class.
 void addMemberVariable(java.lang.String mVarName, java.lang.String mVarClass, boolean isArray)
          Adds a new member variable for the class.
 java.lang.String getClassJavadocs()
          Returns the class javadocs for this class.
 java.lang.String getClassName()
          Returns the class name.
 java.lang.String getInterface()
          Gets the fully qualified interface for this class if specified,
 java.util.List getMemberVariables()
          Returns a list of member variable objects in this class.
 int getNumberOfMemberVariables()
          Returns the number of member variables for this class.
 java.lang.String getPackageName()
          Returns the package name for the class.
 java.lang.String getSuperClass()
          Gets the superclass name for this class.
 boolean hasInterface()
          Convenience methods since velocity does not understand the conditional "== null".
 boolean hasSuperClass()
          Convenience method since velocity does not understand the conditional "== null".
 void setClassJavadocs(java.lang.String classJavadocs)
          Allows setting the class javadocs for this class.
 void setClassName(java.lang.String className)
          Sets the class name.
 void setInterface(java.lang.String interfaceName)
          Sets the fully qualified interface name for this class.
 void setPackageName(java.lang.String packageName)
          Allows setting the package name for the class.
 void setSuperClass(java.lang.String superClass)
          Sets the superclass name if applicable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaSource

public JavaSource()
Method Detail

getPackageName

public java.lang.String getPackageName()
Returns the package name for the class.

Returns:
the package name for the class.

setPackageName

public void setPackageName(java.lang.String packageName)
Allows setting the package name for the class.

Parameters:
packageName - the package name to set.

getClassJavadocs

public java.lang.String getClassJavadocs()
Returns the class javadocs for this class.

Returns:
the class javadocs for this class.

setClassJavadocs

public void setClassJavadocs(java.lang.String classJavadocs)
Allows setting the class javadocs for this class.

Parameters:
classJavadocs - the class level javadocs to set.

getClassName

public java.lang.String getClassName()
Returns the class name.

Returns:
the class name.

setClassName

public void setClassName(java.lang.String className)
Sets the class name.

Parameters:
className - the class name.

getSuperClass

public java.lang.String getSuperClass()
Gets the superclass name for this class.

Returns:
the superclass for this class.

setSuperClass

public void setSuperClass(java.lang.String superClass)
Sets the superclass name if applicable.

Parameters:
superClass - the super class name to set.

getInterface

public java.lang.String getInterface()
Gets the fully qualified interface for this class if specified,

Returns:
the interface name for this class.

setInterface

public void setInterface(java.lang.String interfaceName)
Sets the fully qualified interface name for this class.

Parameters:
interfaceName - the fully qualified interface name for this class.

getMemberVariables

public java.util.List getMemberVariables()
Returns a list of member variable objects in this class.

Returns:
a list of member variable objects in this class.

getNumberOfMemberVariables

public int getNumberOfMemberVariables()
Returns the number of member variables for this class.

Returns:
the number of member variables.

addMemberVariable

public void addMemberVariable(java.lang.String mVarClass,
                              boolean isArray)
Adds a new member variable object for the class. Deduces a variable name from the class name.

Parameters:
mVarClass - the class name for the member variable.
isArray - if the member variable type is an array.

addMemberVariable

public void addMemberVariable(java.lang.String mVarName,
                              java.lang.String mVarClass,
                              boolean isArray)
Adds a new member variable for the class.

Parameters:
mVarName - the name of the member variable.
mVarClass - the class name for the member variable.
isArray - if the member variable type is an array.

hasInterface

public boolean hasInterface()
Convenience methods since velocity does not understand the conditional "== null". Returns true if this class implements an interface.

Returns:
true if this class implements an interface else false.

hasSuperClass

public boolean hasSuperClass()
Convenience method since velocity does not understand the conditional "== null". Returns true if this class inherits from a superclass.

Returns:
true if this class has a superclass, else false.