com.cafesoft.core.field
Class StringFieldInfo

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

public class StringFieldInfo
extends AbstractFieldInfo

String 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 string values. Such as minimum length and maximum length values allowed within a field.

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

Constructor Summary
StringFieldInfo(String name, Object defaultValue, boolean allowNull, boolean isRequired)
          Create String FieldInfo.
 
Method Summary
 FieldType getFieldType()
          Get the FieldType.
 int getMaximumLength()
          Get the maximum required length of the Field.
 int getMinimumLength()
          Get the minimum required length of the Field.
 boolean hasMaximumLength()
          Determine if the Field has a maximum length requirement.
 boolean hasMinimumLength()
          Determine if the Field has a minimum length requirement.
 void setMaximumLength(String value)
          Set the maximum required length of the Field.
 void setMinimumLength(String value)
          Set the minimum required length of the Field.
 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

StringFieldInfo

public StringFieldInfo(String name,
                       Object defaultValue,
                       boolean allowNull,
                       boolean isRequired)
Create String 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.

hasMinimumLength

public boolean hasMinimumLength()
Determine if the Field has a minimum length requirement.

Returns:
true if a minimum length requirement is present, false otherwise.

getMinimumLength

public int getMinimumLength()
Get the minimum required length of the Field.

Returns:
the minimum required length of the Field.

setMinimumLength

public void setMinimumLength(String value)
                      throws IllegalConstraintException
Set the minimum required length of the Field.

Parameters:
value - a String containing the minimum required String length. This value must be greater than or equal to 0.
Throws:
IllegalConstraintException - if value is not a parsable integer value, or if the integer value is less than 0.

hasMaximumLength

public boolean hasMaximumLength()
Determine if the Field has a maximum length requirement.

Returns:
true if a maximum length requirement is present, false otherwise.

getMaximumLength

public int getMaximumLength()
Get the maximum required length of the Field.

Returns:
the maximum required length of the Field.

setMaximumLength

public void setMaximumLength(String value)
                      throws IllegalConstraintException
Set the maximum required length of the Field.

Parameters:
value - a String containing the maximum required String length. This value must be greater than or equal to 0.
Throws:
IllegalConstraintException - if value is not a parsable integer value, or if the integer value is less than 0, or if the maximum value is less than the minimum value.

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 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.