org.sourceforge.ifx.tools
Class MemberVariable

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

public class MemberVariable
extends java.lang.Object

Models a bean property for a IFX bean. The class defines several convenience methods that operate on the member variable name to produce appropriate names for getter and setter functions for the bean member variable.

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

Constructor Summary
MemberVariable(java.lang.String name, java.lang.String className, boolean isArray)
          Constructor to build a MemberVariable object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          The equality check would be used in the call to List.contains() from the addMemberVariable() method in JavaSource.
 java.lang.String getClassName()
          Returns the fully qualified class name of this member variable.
 java.lang.String getElementName()
          Returns the name of the IFX XML element.
 java.lang.String getGetterName()
          Returns the name of the getXXX() method to retrieve this variable from the bean.
 java.lang.String getName()
          Returns the name of this member variable.
 java.lang.String getSetterName()
          Returns the name of the setXXX() method to set this variable within the bean.
 int hashCode()
          This is used to throttle duplicate member variables.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemberVariable

public MemberVariable(java.lang.String name,
                      java.lang.String className,
                      boolean isArray)
Constructor to build a MemberVariable object.

Parameters:
name - the name of the member variable. IFX beans will prefix
className - the fully qualified class name for the variable. an underscore character for private variables automatically.
Method Detail

getClassName

public java.lang.String getClassName()
Returns the fully qualified class name of this member variable.

Returns:
the fully qualified class name of this member variable.

getName

public java.lang.String getName()
Returns the name of this member variable.

Returns:
the name of the member variable.

getGetterName

public java.lang.String getGetterName()
Returns the name of the getXXX() method to retrieve this variable from the bean.

Returns:
the getter method name.

getSetterName

public java.lang.String getSetterName()
Returns the name of the setXXX() method to set this variable within the bean.

Returns:
the setter method name.

getElementName

public java.lang.String getElementName()
Returns the name of the IFX XML element. This involves uppercasing the first character of the name.

Returns:
the element name.

hashCode

public int hashCode()
This is used to throttle duplicate member variables. There are cases in the schema where a member variable can appear in one of two optional sequences, so there should be one member variable regardless of which sequence is populated.

Returns:
a hashcode for the variable name.

equals

public boolean equals(java.lang.Object obj)
The equality check would be used in the call to List.contains() from the addMemberVariable() method in JavaSource.

Parameters:
obj - the Object to compare against.
Returns:
true if the names of the two member variable objects are equal.