com.cafesoft.core.field
Class IntegerFieldInfo

java.lang.Object
  |
  +--com.cafesoft.core.field.AbstractFieldInfo
        |
        +--com.cafesoft.core.field.IntegerFieldInfo
All Implemented Interfaces:
FieldInfo

public class IntegerFieldInfo
extends AbstractFieldInfo

Integer implementation of the FieldInfo object. This implementation is a subclass of the AbstractFieldInfo object. In addition, this class includes several methods that are specific to integer values. Such as minimum and maximum values allowed within a field.

Since:
8/12/03
See Also:
AbstractFieldInfo, FieldInfo

Constructor Summary
IntegerFieldInfo(String name, Object defaultValue, boolean allowNull, boolean isRequired)
          Create Integer FieldInfo.
 
Method Summary
 FieldType getFieldType()
          Get the FieldType.
 int getMaximum()
          Get the maximum integer value.
 int getMinimum()
          Get the minimum integer value.
 boolean hasMaximum()
          Determine if FieldInfo has a maximum value defined.
 boolean hasMinimum()
          Determine if FieldInfo has a minimum value defined.
 void setMaximum(String value)
          Set the maximum value of the IntegerFieldInfo
 void setMinimum(String value)
          Set the minimum value of the IntegerFieldInfo
 String toString()
          Get a String representation of this object.
 
Methods inherited from class com.cafesoft.core.field.AbstractFieldInfo
allowNull, getDefaultValue, getFieldValidationRule, getFieldValueOptions, getName, isRequired, setFieldValidationRule, setFieldValueOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerFieldInfo

public IntegerFieldInfo(String name,
                        Object defaultValue,
                        boolean allowNull,
                        boolean isRequired)
Create Integer FieldInfo.

Parameters:
name - the name of the FieldInfo.
defaultValue - the default value of the FieldInfo object.
allowNull - boolean flag that determines if null is a valid value.
isRequired - boolean flag that determines if a value is required.
Method Detail

getFieldType

public FieldType getFieldType()
Get the FieldType.

Specified by:
getFieldType in interface FieldInfo
Specified by:
getFieldType in class AbstractFieldInfo
Returns:
the FieldType.

setMaximum

public void setMaximum(String value)
                throws IllegalConstraintException
Set the maximum value of the IntegerFieldInfo

Parameters:
value - a String representation of the maximum integer value allowed by the IntegerFieldInfo object.
Throws:
IllegalConstraintException - if an error occurs setting the maximum accepted value, or if the maximum value is less than the minimum value.

getMaximum

public int getMaximum()
Get the maximum integer value.

Returns:
the maximum integer value.

hasMaximum

public boolean hasMaximum()
Determine if FieldInfo has a maximum value defined.

Returns:
true if a maximum value is defined, false otherwise.

setMinimum

public void setMinimum(String value)
                throws IllegalConstraintException
Set the minimum value of the IntegerFieldInfo

Parameters:
value - a String representation of the minimum integer value allowed by the IntegerFieldInfo object.
Throws:
IllegalConstraintException - if an error occurs setting the minimum accepted value.

getMinimum

public int getMinimum()
Get the minimum integer value.

Returns:
the minimum integer value.

hasMinimum

public boolean hasMinimum()
Determine if FieldInfo has a minimum value defined.

Returns:
true if a minimum value is defined, false otherwise.

toString

public String toString()
Get a String representation of this object.

Overrides:
toString in class AbstractFieldInfo
Returns:
a String representation of this object.


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.