|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.ParameterType<String> net.sf.basedb.core.StringParameterType
public class StringParameterType
This class represent a parameter type that is a string.
This type defines a max length
for the text.
Field Summary | |
---|---|
private Integer |
maxLength
|
Constructor Summary | |
---|---|
StringParameterType()
Create a new string parameter type, setting the max length to 255 and nulls are allowed. |
|
StringParameterType(Integer maxLength,
String defaultValue,
boolean notNull)
Create a new string parameter type. |
|
StringParameterType(Integer maxLength,
String defaultValue,
boolean notNull,
int multiplicity,
int width,
int height)
|
|
StringParameterType(Integer maxLength,
String defaultValue,
boolean notNull,
int multiplicity,
int width,
int height,
Enumeration<String,String> items)
|
|
StringParameterType(Integer maxLength,
String defaultValue,
boolean notNull,
int multiplicity,
int width,
int height,
List<String> items)
|
Method Summary | |
---|---|
Integer |
getMaxLength()
Get the max length of the parameter. |
(package private) ParameterValueData<String> |
newParameterValueData()
Create a new TextParameterValueData object. |
String |
toString()
|
private static Type |
typeFromLength(Integer maxLength)
|
(package private) void |
validateValue(String name,
String value)
Checks if the value is a String object
and shorter than the maximum length. |
Methods inherited from class net.sf.basedb.core.ParameterType |
---|
getDefaultValue, getEnumeration, getHeight, getItems, getMultiplicity, getNotNull, getParameterClass, getValueType, getWidth, isEnumeration, validate, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final Integer maxLength
Constructor Detail |
---|
public StringParameterType()
public StringParameterType(Integer maxLength, String defaultValue, boolean notNull)
maxLength
- The maximum length of the string that is allowed or null
to allow as long as possibledefaultValue
- The default value of this parameternotNull
- FALSE if nulls values are allowed, TRUE otherwisepublic StringParameterType(Integer maxLength, String defaultValue, boolean notNull, int multiplicity, int width, int height)
public StringParameterType(Integer maxLength, String defaultValue, boolean notNull, int multiplicity, int width, int height, List<String> items)
public StringParameterType(Integer maxLength, String defaultValue, boolean notNull, int multiplicity, int width, int height, Enumeration<String,String> items)
Method Detail |
---|
public String toString()
toString
in class Object
void validateValue(String name, String value) throws InvalidDataException
String object
and shorter than the maximum length.
- Specified by:
validateValue
in class ParameterType<String>
- Parameters:
value
- The value to testname
- The name of the parameter, use the name if there is need to
throw an exception
- Throws:
InvalidDataException
- If the value is not a string or too long
ParameterValueData<String> newParameterValueData()
TextParameterValueData
object.
newParameterValueData
in class ParameterType<String>
public Integer getMaxLength()
private static Type typeFromLength(Integer maxLength)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |