org.melati.poem.prepro
Class FieldDef

Package class diagram package FieldDef
java.lang.Object
  extended by org.melati.poem.prepro.FieldDef
Direct Known Subclasses:
AtomFieldDef, ColumnTypeFieldDef, DisplayLevelFieldDef, IntegrityFixFieldDef, ReferenceFieldDef, SearchabilityFieldDef

public abstract class FieldDef
extends Object

An abstract definition of a Field from which all other FieldDefs are derived.


Field Summary
protected  String displayLevel
           
protected  int displayOrder
           
protected  int lineNumber
           
protected  String name
           
protected  Vector qualifiers
           
protected  String rawType
           
protected  String searchability
           
protected  String suffix
           
protected  TableDef table
           
protected  String type
           
 
Constructor Summary
FieldDef(int lineNo, TableDef table, String name, String type, String rawType, int displayOrder, Vector qualifiers)
          Constructor.
 
Method Summary
static FieldDef from(TableDef table, StreamTokenizer tokens, int displayOrder)
          Creates the appropriate type of FieldDef from the input stream.
 void generateBaseMethods(Writer w)
          Write out this Column's base methods.
 void generateColAccessor(Writer w)
          Write out this Column's accessors.
 void generateColDecl(Writer w)
          Write out this Column's java declaration string.
 void generateColDefinition(Writer w)
          Write out this Column's definition using an anonymous class.
protected  void generateColRawAccessors(Writer w)
          Write out this Column's field accessors as part of the anonymous definition of the Column.
 void generateFieldCreator(Writer w)
          Write out this Column's field creators.
abstract  void generateJavaDeclaration(Writer w)
          Write out this Field's java declaration string.
 int getHeight()
           
 int getWidth()
           
 boolean isCreateable()
           
 boolean isDeletedColumn()
           
 boolean isEditable()
           
 boolean isIndexed()
           
 boolean isNullable()
           
 boolean isSortDescending()
           
 boolean isTroidColumn()
           
 boolean isUnique()
           
abstract  String poemTypeJava()
           
 void setCreateable(boolean isCreateable)
          Set the isCreatable property.
 void setDeletedColumn(boolean isDeletedColumn)
          Set whether this field represents a deleted marker.
 void setEditable(boolean isEditable)
          Set the isEditable property.
 void setHeight(int height)
          Set the heigth property.
 void setIndexed(boolean isIndexed)
          Set the isIndexed property.
 void setNullable(boolean isNullable)
          Set the nullable property.
 void setSortDescending(boolean sortDescending)
          Set the sortDescending property.
 void setTroidColumn(boolean isTroidColumn)
          Set the isTroidColumn property.
 void setUnique(boolean isUnique)
          Set the isUnique property.
 void setWidth(int width)
          Set the width property.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

table

protected final TableDef table

name

protected final String name

suffix

protected final String suffix

displayOrder

protected int displayOrder

type

protected final String type

rawType

protected final String rawType

qualifiers

protected final Vector qualifiers

displayLevel

protected String displayLevel

searchability

protected String searchability

lineNumber

protected int lineNumber
Constructor Detail

FieldDef

public FieldDef(int lineNo,
                TableDef table,
                String name,
                String type,
                String rawType,
                int displayOrder,
                Vector qualifiers)
         throws org.melati.poem.prepro.IllegalityException
Constructor.

Parameters:
table - the TableDef that this Field is part of
name - the name of this field
type - the POEM type of this field
rawType - the underlying java type of this field
displayOrder - where to place this field in a list
qualifiers - all the qualifiers to be applied to this field
Throws:
IllegalityException - if a semantic inconsistency is detected
Method Detail

toString

public String toString()
Overrides:
toString in class Object
Returns:
a name for this class

from

public static FieldDef from(TableDef table,
                            StreamTokenizer tokens,
                            int displayOrder)
                     throws org.melati.poem.prepro.ParsingDSDException,
                            IOException,
                            org.melati.poem.prepro.IllegalityException
Creates the appropriate type of FieldDef from the input stream.

Parameters:
table - the TableDef we are dealing with
tokens - the StreamTokenizer to get tokens from
displayOrder - the ranking of this Field
Returns:
a new FieldDef of the appropriate type
Throws:
ParsingDSDException - if an unexpected token is encountered
IOException - if something goes wrong with the file system
IllegalityException - if a semantic incoherence is detected

generateBaseMethods

public void generateBaseMethods(Writer w)
                         throws IOException
Write out this Column's base methods.

Parameters:
w - Persistent Base
Throws:
IOException - if something goes wrong with the file system

generateFieldCreator

public void generateFieldCreator(Writer w)
                          throws IOException
Write out this Column's field creators.

Parameters:
w - Persistent Base
Throws:
IOException - if something goes wrong with the file system

generateJavaDeclaration

public abstract void generateJavaDeclaration(Writer w)
                                      throws IOException
Write out this Field's java declaration string.

Parameters:
w - PersistentBase
Throws:
IOException - if something goes wrong with the file system

generateColDecl

public void generateColDecl(Writer w)
                     throws IOException
Write out this Column's java declaration string.

Parameters:
w - TableBase
Throws:
IOException - if something goes wrong with the file system

generateColAccessor

public void generateColAccessor(Writer w)
                         throws IOException
Write out this Column's accessors.

Parameters:
w - TableBase
Throws:
IOException - if something goes wrong with the file system

generateColRawAccessors

protected void generateColRawAccessors(Writer w)
                                throws IOException
Write out this Column's field accessors as part of the anonymous definition of the Column.

Parameters:
w - TableBase
Throws:
IOException - if something goes wrong with the file system

generateColDefinition

public void generateColDefinition(Writer w)
                           throws IOException
Write out this Column's definition using an anonymous class.

Parameters:
w - TableBase
Throws:
IOException - if something goes wrong with the file system

poemTypeJava

public abstract String poemTypeJava()
Returns:
the Java string for this PoemType.

isDeletedColumn

public boolean isDeletedColumn()
Returns:
whether this column is a deleted marker

setDeletedColumn

public void setDeletedColumn(boolean isDeletedColumn)
Set whether this field represents a deleted marker.

Parameters:
isDeletedColumn - boolean

isTroidColumn

public boolean isTroidColumn()
Returns:
whether this field represents a troid column.

setTroidColumn

public void setTroidColumn(boolean isTroidColumn)
Set the isTroidColumn property.

Parameters:
isTroidColumn - boolean

isNullable

public boolean isNullable()
Returns:
whether this column is nullable.

setNullable

public void setNullable(boolean isNullable)
Set the nullable property.

Parameters:
isNullable - boolean

isEditable

public boolean isEditable()
Returns:
whether this field is editable

setEditable

public void setEditable(boolean isEditable)
Set the isEditable property.

Parameters:
isEditable - boolean

isSortDescending

public boolean isSortDescending()
Returns:
whether this column shoudl be sorted in descending order

setSortDescending

public void setSortDescending(boolean sortDescending)
Set the sortDescending property.

Parameters:
sortDescending -

isCreateable

public boolean isCreateable()
Returns:
whether this column is user creatable

setCreateable

public void setCreateable(boolean isCreateable)
Set the isCreatable property.

Parameters:
isCreateable - boolean

isIndexed

public boolean isIndexed()
Returns:
whether this column is indexed.

setIndexed

public void setIndexed(boolean isIndexed)
Set the isIndexed property.

Parameters:
isIndexed - boolean

isUnique

public boolean isUnique()
Returns:
whether this column is unique

setUnique

public void setUnique(boolean isUnique)
Set the isUnique property.

Parameters:
isUnique - boolean

getWidth

public int getWidth()
Returns:
the width

setWidth

public void setWidth(int width)
Set the width property.

Parameters:
width - the width to set

getHeight

public int getHeight()
Returns:
the height

setHeight

public void setHeight(int height)
Set the heigth property.

Parameters:
height - the height to set


Copyright © 2000-2010 PanEris. All Rights Reserved.