JDBaccess API 1.0

com.jdbaccess.transfer
Class Field

java.lang.Object
  extended by com.jdbaccess.transfer.Field
All Implemented Interfaces:
java.io.Serializable

public class Field
extends java.lang.Object
implements java.io.Serializable

Fields are similar to table columns. Fields are part of transfer objects and as a special case are part of rows. Fields have a type, a position, a name, a minimum value, a maximum value, a default value, a length, a flag for required, a flag for hidden, a flag for read only, a maximal precision and scale (if a number field), a sql type and an entity name.

See Also:
Serialized Form

Constructor Summary
Field()
          Constructs a field
Field(java.lang.String name, java.lang.Class type)
          Constructs a field with a field name and a type
 
Method Summary
 java.lang.Object getDefaultValue()
          Returns the default value of this field
 java.lang.String getEntity()
          Gets the entity name
 long getLength()
          Returns the legth of this field
 int getMaxPrecision()
          Returns the default maximum precision of this field
 int getMaxScale()
          Returns the default maximum scale of this field
 java.lang.Object getMaxValue()
          Returns the default maximum value of this field
 java.lang.Object getMinValue()
          Returns the default minimum value of this field
 java.lang.String getName()
          Returns the name of this field
 int getPosition()
          Gets the position of this field in result (e.g. for table column ordering) beginning at 1
 java.lang.Integer getSQLType()
          Gets the sql type of this field
 java.lang.Class getType()
          Returns the type of this field (e.g.
 boolean isHidden()
          Returns true if hidden else false.
 boolean isReadOnly()
          Returns true if read only else false
 boolean isRequired()
          Returns true if required else false
 void setDefaultValue(java.lang.Object defaultValue)
          Sets the default value of this field
 void setEntity(java.lang.String string)
          Sets the entity name of this field
 void setHidden(boolean hidden)
          Sets the hidden flag of this field
 void setLength(long length)
          Sets the length for this field
 void setMaxPrecision(int maxPrecision)
          Sets the maximum precision for this field
 void setMaxScale(int maxScale)
          Sets the maximum scale for this field
 void setMaxValue(java.lang.Object maxValue)
          Sets the maximum value for this field
 void setMinValue(java.lang.Object minValue)
          Sets the minimum value for this field
 void setName(java.lang.String name)
          Sets the name of this field
 void setPosition(int position)
          Sets the position of this field in result (e.g. for table column ordering) beginning at 1
 void setReadOnly(boolean readOnly)
          Sets the read only flag of this field
 void setRequired(boolean required)
          Sets the required flag of this field
 void setSQLType(java.lang.Integer sqlType)
          Sets the sql type of this field
 void setType(java.lang.Class type)
          Sets the type of this field
 java.lang.String toString()
          Gets the String representation of this field
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Field

public Field()
Constructs a field


Field

public Field(java.lang.String name,
             java.lang.Class type)
Constructs a field with a field name and a type

Parameters:
name - name of this field
type - type of this field (e.g. Date.class for a Date-Field)
Method Detail

toString

public java.lang.String toString()
Gets the String representation of this field

Overrides:
toString in class java.lang.Object
Returns:
String representation of this field

getDefaultValue

public java.lang.Object getDefaultValue()
Returns the default value of this field

Returns:
default value of this field

isHidden

public boolean isHidden()
Returns true if hidden else false.

Returns:
true if hidden else false

getLength

public long getLength()
Returns the legth of this field

Returns:
length of this field

getMaxPrecision

public int getMaxPrecision()
Returns the default maximum precision of this field

Returns:
default maximum precision

getMaxScale

public int getMaxScale()
Returns the default maximum scale of this field

Returns:
default maximum scale

getMaxValue

public java.lang.Object getMaxValue()
Returns the default maximum value of this field

Returns:
default maximum value of this field

getMinValue

public java.lang.Object getMinValue()
Returns the default minimum value of this field

Returns:
default minimum value of this field

getName

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

Returns:
name of this field

isReadOnly

public boolean isReadOnly()
Returns true if read only else false

Returns:
true if read only else false

isRequired

public boolean isRequired()
Returns true if required else false

Returns:
true if required else false

getType

public java.lang.Class getType()
Returns the type of this field (e.g. Date.class for a Date-Field)

Returns:
type of this field (e.g. Date.class for a Date-Field)

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Sets the default value of this field

Parameters:
defaultValue - default value of this field

setHidden

public void setHidden(boolean hidden)
Sets the hidden flag of this field

Parameters:
hidden - if true set field to hidden else it is visible

setLength

public void setLength(long length)
Sets the length for this field

Parameters:
length - length for this field

setMaxPrecision

public void setMaxPrecision(int maxPrecision)
Sets the maximum precision for this field

Parameters:
maxPrecision - maximum precision for this field

setMaxScale

public void setMaxScale(int maxScale)
Sets the maximum scale for this field

Parameters:
maxScale - maximum scale for this field

setMaxValue

public void setMaxValue(java.lang.Object maxValue)
Sets the maximum value for this field

Parameters:
maxValue - maximum value for this field

setMinValue

public void setMinValue(java.lang.Object minValue)
Sets the minimum value for this field

Parameters:
minValue - minimum value for this field

setName

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

Parameters:
name - name of this field

setReadOnly

public void setReadOnly(boolean readOnly)
Sets the read only flag of this field

Parameters:
readOnly - if true set field to read only else it is also writable

setRequired

public void setRequired(boolean required)
Sets the required flag of this field

Parameters:
required - if true set field to required else it is optional

setType

public void setType(java.lang.Class type)
Sets the type of this field

Parameters:
type - type the type of this field (e.g. Date.class for a Date-Field)

setSQLType

public void setSQLType(java.lang.Integer sqlType)
Sets the sql type of this field

Parameters:
sqlType - sql type of this field as an Integer

getSQLType

public java.lang.Integer getSQLType()
Gets the sql type of this field

Returns:
sql type of this field as an Integer

getEntity

public java.lang.String getEntity()
Gets the entity name

Returns:
table name of this field

setEntity

public void setEntity(java.lang.String string)
Sets the entity name of this field

Parameters:
string - table name of this field

getPosition

public int getPosition()
Gets the position of this field in result (e.g. for table column ordering) beginning at 1

Returns:
position

setPosition

public void setPosition(int position)
Sets the position of this field in result (e.g. for table column ordering) beginning at 1

Parameters:
position - position to set

JDBaccess API 1.0

Copyright © 2005-2006 JDBaccess.com, Königsweg 210, D-14129 Berlin, Germany. All Rights Reserved.