Novell exteNd
Director 5.2 API

com.novell.afw.portlet.api
Interface EbiPortletPreferenceInteger

All Superinterfaces:
Cloneable, EbiPortletPreference

public interface EbiPortletPreferenceInteger
extends EbiPortletPreference

Interface representing an Integer type of EbiPortletPreference. It provides methods that are useful for working with single valued Integer preferences. The Integer type can conatain an optional range, which if set will constrain the the value (upon validation) to an integer within the range inclusive.

Since:
v5.0

Inner Class Summary
static interface EbiPortletPreferenceInteger.Range
          Inner interface representing a Range for the integer preferenece.
 
Fields inherited from interface com.novell.afw.portlet.api.EbiPortletPreference
TYPE_BOOLEAN, TYPE_COMPLEX, TYPE_INTEGER, TYPE_PASSWORD, TYPE_SELECT, TYPE_STRING
 
Method Summary
 void clearRange()
          Removes the range restriction.
 int getIntValue()
          A convienence method that allows getting of the int value of the preference.
 EbiPortletPreferenceInteger.Range getRange()
          Returns the the minimum and maximum value allowable for this preference or null if no range has been set.
 void setIntValue(int value)
          A convienence method that allows setting of the int value of the preference.
 void setRange(int min, int max)
          Sets the minimum and maximum range for this value.
 
Methods implemented from interface com.novell.afw.portlet.api.EbiPortletPreference
getDataType, getDescription, getDisplayableXML, getDisplayName, getLocale, getName, getValue, getValue, getValues, getValues, isEncrypted, isHiddenFromUser, isMultiValued, isReadOnly, isRequired, setDescription, setDisplayName, setHiddenFromUser, setMultiValued, setReadOnly, setRequired, setValue, setValues, validate
 

Method Detail

getIntValue

public int getIntValue()
A convienence method that allows getting of the int value of the preference. If the value can not be coerced into an int, a runtime exception (NumberFormatException) will be thrown. This method operates on only the first element if the preference has multiple values.
Returns:
int value of the preference, or 0 if the string value is null.
Since:
v5.0

setIntValue

public void setIntValue(int value)
A convienence method that allows setting of the int value of the preference. This method operates on only the first element if the preference has multiple values.
Parameters:
value - the new value for the preference.
Since:
v5.0

getRange

public EbiPortletPreferenceInteger.Range getRange()
Returns the the minimum and maximum value allowable for this preference or null if no range has been set.
Returns:
Range object or null if no range has been applied to this preference.
Since:
v5.0

clearRange

public void clearRange()
Removes the range restriction. Once this is done, any valid integer value is permitted.
Since:
v5.0

setRange

public void setRange(int min,
                     int max)
Sets the minimum and maximum range for this value. This range can be used by the UI to render restrictions on the value and to test validity of the value the user entered. Note that the restriction only comes into play when the validate() method is called.
Since:
v5.0

Novell exteNd
Director 5.2 API