org.prorefactor.core.schema
Class Field

java.lang.Object
  extended by org.prorefactor.core.schema.Field
All Implemented Interfaces:
Xferable, Primative

public class Field
extends java.lang.Object
implements Primative, Xferable

Field objects are created both by the Schema class and they are also created for temp and work table fields defined within a 4gl compile unit.


Nested Class Summary
static class Field.Name
          This is a convenience class for working with a string field name, where there may or may not be a database or table qualifier in the name.
 
Constructor Summary
Field()
          Only to be used for persistence/serialization.
Field(java.lang.String inName, Table table)
          Standard constructor.
 
Method Summary
 void assignAttributesLike(Primative likePrim)
          Assign datatype, class, extent from another primative (for the LIKE keyword).
 Field copyBare(Table toTable)
          Copy the bare minimum attributes to a new Field object.
 java.lang.String getClassName()
          The name of the CLASS that this variable was defined for.
 DataType getDataType()
           
 int getExtent()
           
 java.lang.String getName()
           
 Table getTable()
           
 Primative setClassName(java.lang.String s)
           
 Primative setDataType(DataType dataType)
           
 Primative setExtent(int extent)
           
 void setTable(Table table)
          Use this to set the field to a table if you used null for the table in the constructor.
 void writeXferBytes(DataXferStream out)
          Implement Xferable.
 void writeXferSchema(DataXferStream out)
          Implement Xferable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Field

public Field()
Only to be used for persistence/serialization.


Field

public Field(java.lang.String inName,
             Table table)
Standard constructor.

Parameters:
table - Use null if you want to assign the field to a table as a separate step.
See Also:
setTable(Table)
Method Detail

assignAttributesLike

public void assignAttributesLike(Primative likePrim)
Description copied from interface: Primative
Assign datatype, class, extent from another primative (for the LIKE keyword).

Specified by:
assignAttributesLike in interface Primative

copyBare

public Field copyBare(Table toTable)
Copy the bare minimum attributes to a new Field object.

Parameters:
toTable - The table that the field is being added to.
Returns:
The newly created Field, though you may not need it for anything since it has already been added to the Table.

getClassName

public java.lang.String getClassName()
Description copied from interface: Primative
The name of the CLASS that this variable was defined for. This is more interesting than getDataType, which returns CLASS. Returns null if this variable was not defined for a CLASS. TODO For 10.1B support, this should return the fully qualified class name, even if the reference wasn't fully qualfied. If that's not to be the case, then John needs to look at method signatures implementation in Callgraph.

Specified by:
getClassName in interface Primative
See Also:
Primative.getClassName()

getDataType

public DataType getDataType()
Specified by:
getDataType in interface Primative

getExtent

public int getExtent()
Specified by:
getExtent in interface Primative

getName

public java.lang.String getName()

getTable

public Table getTable()

setClassName

public Primative setClassName(java.lang.String s)
Specified by:
setClassName in interface Primative

setDataType

public Primative setDataType(DataType dataType)
Specified by:
setDataType in interface Primative

setExtent

public Primative setExtent(int extent)
Specified by:
setExtent in interface Primative

setTable

public void setTable(Table table)
Use this to set the field to a table if you used null for the table in the constructor.


writeXferBytes

public void writeXferBytes(DataXferStream out)
                    throws java.io.IOException
Implement Xferable.

Specified by:
writeXferBytes in interface Xferable
Throws:
java.io.IOException

writeXferSchema

public void writeXferSchema(DataXferStream out)
                     throws java.io.IOException
Implement Xferable.

Specified by:
writeXferSchema in interface Xferable
Throws:
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.