com.finalist.jaggenerator.modules
Class Field

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended bycom.finalist.jaggenerator.modules.Field
All Implemented Interfaces:
java.lang.Cloneable, JagBean, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class Field
extends javax.swing.tree.DefaultMutableTreeNode
implements JagBean

Author:
hillie
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.tree.DefaultMutableTreeNode
 
Field Summary
 javax.swing.JCheckBox autoGeneratedCheckBox
           
 javax.swing.JCheckBox foreignKeyCheckBox
           
 javax.swing.JCheckBox primaryKeyCheckBox
           
 javax.swing.JCheckBox requiredCheckBox
           
 javax.swing.JTextField validationDependsText
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
Field(Entity parent, Column column)
          Creates new form BeanForm
Field(Entity parent, org.w3c.dom.Element el)
          Use for building up the entity field gui component
 
Method Summary
 java.lang.String getColumnName()
           
 TemplateString getForeignKey()
           
 boolean getHasAutoGenPrimaryKey()
           
 TemplateString getJdbcType()
           
 java.lang.String getJdbcType(Column column)
           
 TemplateString getName()
          Returns the name of the field
 javax.swing.JPanel getPanel()
           
 TemplateString getPrimaryKey()
           
 java.lang.String getRefName()
           
 Relation getRelation()
          Gets the relation, if this field represents a container-managed relation field in its parent entity bean.
 java.lang.String getSize()
          Return the size of a sql type in case it is a string type.
 TemplateString getSqlType()
           
 java.lang.String getSqlType(Column column)
           
 java.lang.String getType()
          Returns the class that represents the primary key type
 java.lang.String getType(Column column)
           
 java.lang.String getValidationDepends()
           
 java.lang.String getValidationXml()
           
 void getXML(org.w3c.dom.Element el)
           
 boolean isForeignKey()
           
 boolean isNullable()
          Make the nullable field available.
 boolean isPkClassIsAutogeneratable()
           
 boolean isPrimaryKey()
          Indicates whether the field is part of the primary key.
 boolean isRelation()
           
 boolean isRequired()
          Return true if the field is required, so nullable is true.
 void regenerateValidations()
          Regenerates the Struts validations for this field.
 void setForeignKey(boolean foreignKey)
          Setter for this field, which specifies whether or not this Field is a foreign key field within its table.
 void setHasAutoGenPrimaryKey(boolean value)
           
 void setJdbcType(java.lang.String text)
           
 void setName(java.lang.String name)
          Sets the name of the field
 void setPrimaryKey(boolean value)
          A heap of things happen when you set a field as primary key - keep them all here!
 void setRelation(Relation relation)
           
 void setSqlType(java.lang.String text)
           
 void setType(java.lang.String text)
          Set the field type
 java.lang.String toString()
           
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

autoGeneratedCheckBox

public javax.swing.JCheckBox autoGeneratedCheckBox

foreignKeyCheckBox

public javax.swing.JCheckBox foreignKeyCheckBox

primaryKeyCheckBox

public javax.swing.JCheckBox primaryKeyCheckBox

requiredCheckBox

public javax.swing.JCheckBox requiredCheckBox

validationDependsText

public javax.swing.JTextField validationDependsText
Constructor Detail

Field

public Field(Entity parent,
             Column column)
Creates new form BeanForm


Field

public Field(Entity parent,
             org.w3c.dom.Element el)
Use for building up the entity field gui component

Method Detail

toString

public java.lang.String toString()

getPanel

public javax.swing.JPanel getPanel()
Specified by:
getPanel in interface JagBean

getXML

public void getXML(org.w3c.dom.Element el)
Specified by:
getXML in interface JagBean

getSqlType

public TemplateString getSqlType()

setSqlType

public void setSqlType(java.lang.String text)

getJdbcType

public TemplateString getJdbcType()

setJdbcType

public void setJdbcType(java.lang.String text)

getPrimaryKey

public TemplateString getPrimaryKey()

getForeignKey

public TemplateString getForeignKey()

getValidationDepends

public java.lang.String getValidationDepends()

getValidationXml

public java.lang.String getValidationXml()

getType

public java.lang.String getType(Column column)

getJdbcType

public java.lang.String getJdbcType(Column column)

getSqlType

public java.lang.String getSqlType(Column column)

getRefName

public java.lang.String getRefName()
Specified by:
getRefName in interface JagBean

isPrimaryKey

public boolean isPrimaryKey()
Indicates whether the field is part of the primary key.

Returns:
true if the field is part of the primary key

getHasAutoGenPrimaryKey

public boolean getHasAutoGenPrimaryKey()

setHasAutoGenPrimaryKey

public void setHasAutoGenPrimaryKey(boolean value)

setForeignKey

public void setForeignKey(boolean foreignKey)
Setter for this field, which specifies whether or not this Field is a foreign key field within its table.

Parameters:
foreignKey -

isForeignKey

public boolean isForeignKey()

getType

public java.lang.String getType()
Returns the class that represents the primary key type

Returns:
the class that represents the primary key type

setType

public void setType(java.lang.String text)
Set the field type

Parameters:
text - type.

getName

public TemplateString getName()
Returns the name of the field

Returns:
the name of the field.

setName

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

Parameters:
name - the name of the field.

getColumnName

public java.lang.String getColumnName()

getRelation

public Relation getRelation()
Gets the relation, if this field represents a container-managed relation field in its parent entity bean.

Returns:
the Relation object, or null if this field doesn't represent a relation.

setRelation

public void setRelation(Relation relation)

isRelation

public boolean isRelation()

isNullable

public boolean isNullable()
Make the nullable field available.

Returns:
true if the field is nullable.

isRequired

public boolean isRequired()
Return true if the field is required, so nullable is true.

Returns:
true if the field is required.

getSize

public java.lang.String getSize()
Return the size of a sql type in case it is a string type. Otherwise return null.

Returns:

regenerateValidations

public void regenerateValidations()
Regenerates the Struts validations for this field.


setPrimaryKey

public void setPrimaryKey(boolean value)
A heap of things happen when you set a field as primary key - keep them all here!

Parameters:
value -

isPkClassIsAutogeneratable

public boolean isPkClassIsAutogeneratable()


Copyright © 2003-2005 SourceForge. All Rights Reserved.