public static class PropertiesQuestion.StringConstraints extends PropertiesQuestion.ValueConstraints
Modifier and Type | Field and Description |
---|---|
protected boolean |
custom |
protected int |
nominalMaxLength
The nominal maximum length for the string.
|
protected java.lang.String[] |
suggestions
Current value set for the suggested response values.
|
Constructor and Description |
---|
PropertiesQuestion.StringConstraints() |
PropertiesQuestion.StringConstraints(int maxLen)
Construct with max string length restriction.
|
PropertiesQuestion.StringConstraints(java.lang.String[] suggestions) |
PropertiesQuestion.StringConstraints(java.lang.String[] suggestions,
int maxLen)
Construct with max string length restriction and suggested
responses.
|
Modifier and Type | Method and Description |
---|---|
int |
getNominalMaxLength()
Get the nominal maximum length for the string.
|
java.lang.String[] |
getSuggestions()
Determine what the current value suggestions are.
|
boolean |
isCustomValuesAllowed()
Can the user provide whatever string answer they wish, or must they
choose only from the suggested values.
|
void |
setCustomValuesAllowed(boolean state)
Are user specified values allowed? If not, there must be
suggestions present.
|
void |
setNominalMaxLength(int nominalMaxLength)
Set the expected maximum length for the string.
|
void |
setSuggestions(java.lang.String[] sugs)
Supply some possible values that the user may want to
select from.
|
isReadOnly, isUnsetAllowed, isValid, isVisible, setReadOnly, setUnsetAllowed, setVisible
protected java.lang.String[] suggestions
setSuggestions(String[])
,
getSuggestions()
protected boolean custom
protected int nominalMaxLength
public PropertiesQuestion.StringConstraints()
public PropertiesQuestion.StringConstraints(java.lang.String[] suggestions)
public PropertiesQuestion.StringConstraints(int maxLen)
maxLen
- Maximum length string for the response.public PropertiesQuestion.StringConstraints(java.lang.String[] suggestions, int maxLen)
maxLen
- Maximum length string for the response.suggestions
- The suggested responses to present the user with.
Should be an array of greater than zero length.public void setSuggestions(java.lang.String[] sugs)
sugs
- The suggested responses to present the user with.
Should be an array of greater than zero length. Can be null if
you wish to remove the setting completely.isCustomValuesAllowed()
,
getSuggestions()
public java.lang.String[] getSuggestions()
public void setCustomValuesAllowed(boolean state)
java.lang.IllegalStateException
- If no suggestions have been
provided.setSuggestions(java.lang.String[])
public boolean isCustomValuesAllowed()
public int getNominalMaxLength()
setNominalMaxLength(int)
public void setNominalMaxLength(int nominalMaxLength)
nominalMaxLength
- the nominal maximum length for the string.getNominalMaxLength()
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.