com.altair.hwm.database.dbmodel
Class HWMAttribute

java.lang.Object
  extended by com.altair.hwm.database.dbmodel.HWMAttribute
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
HWMForeignAttribute

public class HWMAttribute
extends java.lang.Object
implements java.beans.PropertyChangeListener

Title: HWMAttribute

Description: This represents a basic attribute in a class

Company: Altair Engineering, Inc.


Field Summary
static java.lang.String PROP_ATTRIB_CONST
          The property name for the event fired when the constraints are changed
static java.lang.String PROP_ATTRIB_DISPLAY
          The property name for the event fired when the display name is changed
static java.lang.String PROP_ATTRIB_NAME
          The property name for the event fired when the name is changed
static java.lang.String PROP_ATTRIB_TYPE
          The property name for the event fired when the type is changed
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
          Add property change listener
 void addVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
          Add vetoable change listener
 void Export(org.jdom.Element elemAttrib)
          Creates XML element representation for this attribute
 HWMAttributeConstraints GetConstraints()
          Gets the constraint object for this attribute.
 java.lang.String GetDisplayName()
          Gets the display name for the attribute
 HWMClass GetHWMClass()
          Returns the class to which this attribute belongs to
 java.lang.String GetName()
          Gets the name of the attribute
 java.lang.String GetSQLRepresentation(HWMDatabaseInfo hwmDBInfo)
          Create and return the SQL string for the attribute
 java.lang.String GetType()
          Gets the type of the attribute
 void Import(org.jdom.Element elemAttrib)
          Recreates the attribute
 boolean IsEditable()
          returns a flag indicating if this attribute can be edited
 boolean IsVisible()
          returns a flag indicating if this class should be visible in the view of the datamodel i.e.
 void propertyChange(java.beans.PropertyChangeEvent propChangeEvt)
          This event is fired whenever this attribute's constraints are changed
 void removePropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
          Remove property change listener
 void removeVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
          Remove vetoable change listener
 void SetDisplayName(java.lang.String strDisplayName)
          Sets the display name for the attribute
 void SetEditable(boolean bEditable)
          Sets the flag indicating if this attribute can be edited
 void SetName(java.lang.String strName)
          Sets the name of the attribute
 void SetType(java.lang.String strType)
          Sets the type of the attribute
 void SetVisible(boolean bVisible)
          Sets the flag indicating if this class should be visible in the view of the datamodel i.e.
 java.lang.String toString()
          Returns the name for this attribute
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_ATTRIB_NAME

public static java.lang.String PROP_ATTRIB_NAME
The property name for the event fired when the name is changed


PROP_ATTRIB_DISPLAY

public static java.lang.String PROP_ATTRIB_DISPLAY
The property name for the event fired when the display name is changed


PROP_ATTRIB_TYPE

public static java.lang.String PROP_ATTRIB_TYPE
The property name for the event fired when the type is changed


PROP_ATTRIB_CONST

public static java.lang.String PROP_ATTRIB_CONST
The property name for the event fired when the constraints are changed

Method Detail

GetHWMClass

public HWMClass GetHWMClass()
Returns the class to which this attribute belongs to

Returns:
HWMClass The class to which this attribute belongs to

GetName

public java.lang.String GetName()
Gets the name of the attribute

Returns:
String Name of this attribute.

SetName

public void SetName(java.lang.String strName)
             throws java.beans.PropertyVetoException
Sets the name of the attribute

Parameters:
strName - Name of this attribute.
Throws:
java.beans.PropertyVetoException

GetDisplayName

public java.lang.String GetDisplayName()
Gets the display name for the attribute

Returns:
String Display name for this attribute.

SetDisplayName

public void SetDisplayName(java.lang.String strDisplayName)
Sets the display name for the attribute

Parameters:
strDisplay - Display name for this attribute.

GetType

public java.lang.String GetType()
                         throws java.lang.Exception
Gets the type of the attribute

Returns:
String type of this attribute.
Throws:
java.lang.Exception

SetType

public void SetType(java.lang.String strType)
Sets the type of the attribute

Parameters:
strType - Type of this attribute.

IsEditable

public boolean IsEditable()
returns a flag indicating if this attribute can be edited

Returns:
boolean If true, it can be edited else not

SetEditable

public void SetEditable(boolean bEditable)
Sets the flag indicating if this attribute can be edited

Parameters:
bEditable - If true, it can be edited else not

IsVisible

public boolean IsVisible()
returns a flag indicating if this class should be visible in the view of the datamodel i.e. DBCreator

Returns:
boolean If true, it is visible else not

SetVisible

public void SetVisible(boolean bVisible)
Sets the flag indicating if this class should be visible in the view of the datamodel i.e. DBCreator

Parameters:
bVisible - If true, it is visible else not

GetConstraints

public HWMAttributeConstraints GetConstraints()
Gets the constraint object for this attribute.

Returns:
HWMAttributeConstraints The constraints for this attribute.

GetSQLRepresentation

public java.lang.String GetSQLRepresentation(HWMDatabaseInfo hwmDBInfo)
Create and return the SQL string for the attribute

Parameters:
hwmDBInfo - The DB info that contains the types supported and the syntax used by the DB
Returns:
String The SQL representation for the attribute

Export

public void Export(org.jdom.Element elemAttrib)
Creates XML element representation for this attribute

Parameters:
elemAttrib - The element representing this attribute

Import

public void Import(org.jdom.Element elemAttrib)
            throws java.lang.Exception
Recreates the attribute

Parameters:
elemAttrib - The element representing this attribute
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Returns the name for this attribute

Overrides:
toString in class java.lang.Object
Returns:
String The namefor this attribute

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
Add property change listener

Parameters:
propChangeListener - The listener for property change events fired by this class

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener propChangeListener)
Remove property change listener

Parameters:
propChangeListener - The listener to be removed

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
Add vetoable change listener

Parameters:
vetoableChangeListener - The listener for vetoable change events fired by this class

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener vetoableListener)
Remove vetoable change listener

Parameters:
vetoableListener - The listener to be removed

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent propChangeEvt)
This event is fired whenever this attribute's constraints are changed

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
propChangeEvt - The property change event object