com.sas.prompts.definitions
Class IntegerDefinition

com.sas.prompts.definitions.IntegerDefinition
All Implemented Interfaces:
com.sas.models.VersionInterface, com.sas.prompts.definitions.HintableDefinitionInterface, com.sas.prompts.definitions.HintableDefinitionV2Interface, com.sas.prompts.definitions.IntegerDefinitionInterface, com.sas.prompts.definitions.IntegerDefinitionV2Interface, com.sas.prompts.definitions.MutableHintableDefinitionInterface, com.sas.prompts.definitions.MutableHintableDefinitionV2Interface, com.sas.prompts.definitions.MutableIntegerDefinitionInterface, com.sas.prompts.definitions.MutableIntegerDefinitionV2Interface, com.sas.prompts.definitions.MutablePromptDefinitionInterface, com.sas.prompts.definitions.MutablePromptDefinitionV2Interface, com.sas.prompts.definitions.MutablePromptDefinitionV3Interface, MutableSelectableDefinitionInterface, MutableValueProviderDefinitionInterface, com.sas.prompts.definitions.MutableValueRetrieverDefinitionInterface, PromptDefinitionInterface, com.sas.prompts.definitions.PromptDefinitionV2Interface, com.sas.prompts.definitions.PromptDefinitionV3Interface, SelectableDefinitionInterface, com.sas.prompts.definitions.SelectableDefinitionV2Interface, ValueProviderDefinitionInterface, com.sas.prompts.definitions.ValueRetrieverDefinitionInterface, com.sas.prompts.IdentifiablePromptInterface, com.sas.prompts.MutableIdentifiablePromptInterface, com.sas.prompts.MutablePromptHelpInterface, com.sas.prompts.PromptHelpInterface, com.sas.PublicClonable, com.sas.storage.editableproperties.LocalizableProperties, com.sas.storage.editableproperties.MultiLocaleProperties, com.sas.storage.valueprovider.AllowUserValuesInterface, com.sas.uiconfig.ContextEnabledObject, com.sas.util.AttributeConfigurationInterface, com.sas.util.AttributeDescription, com.sas.util.log.ComponentLogFactoryInterface, com.sas.util.macrovar.MacroVariableListOptionInterface, com.sas.util.macrovar.MacroVariableOptionInterface, com.sas.util.macrovar.MutableMacroVariableListOptionInterface, com.sas.util.macrovar.MutableMacroVariableOptionInterface, com.sas.util.MutableSupportedSpecialValuesInterface, com.sas.util.ResourceReferencesInterface, com.sas.util.SupportedSpecialValuesInterface, com.sas.util.xmlpersist.PersistenceInterface, java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

public class IntegerDefinition
implements com.sas.prompts.definitions.MutableIntegerDefinitionV2Interface

IntegerDefinition is a prompt type which allows the specification of one or more integer values.

Since:
9.2
See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Fields inherited from interface com.sas.prompts.definitions.SelectableDefinitionInterface
MULTIPLE_SELECTION, ORDERED_MULTIPLE_SELECTION, SINGLE_SELECTION
 
Constructor Summary
IntegerDefinition()
          Constructor
IntegerDefinition(java.lang.String promptName)
          Constructor
 
Method Summary
 java.lang.Object clone()
          Clone this PromptDefinition.
 void configureAttributes(java.util.Map<java.lang.String,?> options, java.util.Map<java.lang.String,?> context)
           
 java.util.List getAttributeDescriptors(java.util.Locale locale)
           
protected  java.util.Map<java.lang.String,java.lang.String> getConstraints(java.util.Locale locale)
           
 int getMaximum()
          Returns the maximum allowed value for the prompt.
 int getMaximumValueCount()
          Returns the maximum number of values the user is allowed to select.
 int getMinimum()
          Returns the minimum allowed value for the prompt.
 int getMinimumValueCount()
          Returns the minimum number of values the user is allowed to select.
 com.sas.datatypes.DataTypeInterface getPromptDataType()
          Returns an instance of com.sas.datatypes.CollectionType or com.sas.datatypes.IntegerType that can be used to process values for this prompt.
 java.util.Collection<ValidationEntry> getPromptValueValidationErrors(java.lang.Object value, java.util.Locale locale)
          Returns a Collection containing the set of ValidationEntry objects or an empty collection if no errors were found.
 int getSelectionType()
          Returns the type of selection that the prompt supports.
 com.sas.util.SupportedSpecialValues getSupportedSpecialValues()
           
 com.sas.storage.valueprovider.ValueProviderInterface getValueProvider()
          Returns the value provider to use to access possible values for the prompt.
 com.sas.storage.vr.dto.ValueRetrieverConfiguration getValueRetrieverConfiguration()
          Returns the ValueRetrieverConfiguration instance that was set, if any.
 java.lang.String getVersion()
           
 boolean isAllowUserValues()
           
 boolean isPromptValueValid(java.lang.Object value, java.util.Locale locale)
          Returns whether the specified value meets the constraints on the prompt definition.
 boolean isRequired()
          Returns whether the prompt value is required to be set before the user can continue with the operation being prompted for.
 boolean isSelectionOrdered()
          Returns whether the values the user selects should be ordered.
 void setAllowUserValues(boolean allowValues)
          Sets whether the user should be allowed to specify values in addition to those returned by the value provider.
 void setMaximum(int maximum)
          Sets the maximum allowed value for the prompt.
 void setMaximumValueCount(int maximumValueCount)
          Sets the maximum number of valid values for a prompt.
 void setMinimum(int minimum)
          Sets the minimum allowed value for the prompt.
 void setMinimumValueCount(int minimumValueCount)
          Sets the minimum number of valid values for a prompt.
 void setSelectionOrdered(boolean selectionOrdered)
          Sets whether the order in which values are selected should be retained.
 void setSupportedSpecialValues(com.sas.util.SupportedSpecialValues specialValuesSupported)
           
 void setValueProvider(com.sas.storage.valueprovider.ValueProviderInterface valueProvider)
          Sets the value provider which will be used to determine the set of possible values for the prompt.
 void setValueRetrieverConfiguration(com.sas.storage.vr.dto.ValueRetrieverConfiguration config)
          Sets the ValueRetrieverConfiguration instance.
 java.util.Collection<ValidationEntry> validateDefinition(java.util.Locale locale)
          This method is used to validate that the various attributes of the definition all contain valid values.
 boolean validIndividualValue(java.lang.Object value, java.util.Locale locale)
          Validates an individual value in a locale-specific way as appropriate.
 
Methods inherited from class com.sas.prompts.definitions.PromptDefinition
addUserInfo, clearDefaultValue, getApplicationContext, getCustomErrorMessage, getCustomErrorMessages, getDefaultValue, getDependentPromptsForAttributes, getHint, getHintPlacement, getHints, getInlineHint, getInlineHints, getLabelPlacement, getLocalizableProperties, getMutableUserInfo, getPromptDescription, getPromptDescriptions, getPromptHelp, getPromptID, getPromptLabel, getPromptLabels, getPromptName, getScript, getScripts, getUIConfiguration, getUserInfo, getUserInfoAsText, isDefaultValueSet, isDisplayDefaultValueAsBlank, isFixed, isHidden, isPromptValueValid, isValueClearedForNonSelectedModalChoiceGroup, removeScript, removeUserInfo, setAdditionalCascadeDependencies, setApplicationContext, setCustomErrorMessage, setCustomErrorMessages, setDefaultValue, setDependentPromptsForAttributes, setDisplayDefaultValueAsBlank, setFixed, setHidden, setHint, setHintPlacement, setHints, setInlineHint, setInlineHints, setLabelPlacement, setLocalizableProperties, setPromptDescription, setPromptDescriptions, setPromptHelp, setPromptLabel, setPromptLabels, setPromptName, setScript, setUIConfiguration, setUserInfo, setValueClearedForNonSelectedModalChoiceGroup, toString
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

IntegerDefinition

public IntegerDefinition()
Constructor


IntegerDefinition

public IntegerDefinition(java.lang.String promptName)
Constructor

Parameters:
promptName -
Method Detail

getMinimum

public int getMinimum()
Returns the minimum allowed value for the prompt.

Specified by:
getMinimum in interface com.sas.prompts.definitions.IntegerDefinitionInterface
Returns:
the minimum allowed value for the prompt.

setMinimum

public void setMinimum(int minimum)
Sets the minimum allowed value for the prompt.

Specified by:
setMinimum in interface com.sas.prompts.definitions.MutableIntegerDefinitionInterface
Parameters:
minimum - the minimum allowed value for the prompt.

getMaximum

public int getMaximum()
Returns the maximum allowed value for the prompt.

Specified by:
getMaximum in interface com.sas.prompts.definitions.IntegerDefinitionInterface
Returns:
the maximum allowed value for the prompt.

setMaximum

public void setMaximum(int maximum)
Sets the maximum allowed value for the prompt.

Specified by:
setMaximum in interface com.sas.prompts.definitions.MutableIntegerDefinitionInterface
Parameters:
maximum - the minimum allowed value for the prompt.

isPromptValueValid

public boolean isPromptValueValid(java.lang.Object value,
                                  java.util.Locale locale)
Returns whether the specified value meets the constraints on the prompt definition.

Specified by:
isPromptValueValid in interface com.sas.prompts.definitions.PromptDefinitionV2Interface
Overrides:
isPromptValueValid in class PromptDefinition
Parameters:
value - The value to check for validity.
Returns:
boolean true if the value is valid, false otherwise
See Also:
PromptDefinitionInterface.isPromptValueValid(Object)

getPromptValueValidationErrors

public java.util.Collection<ValidationEntry> getPromptValueValidationErrors(java.lang.Object value,
                                                                            java.util.Locale locale)
Returns a Collection containing the set of ValidationEntry objects or an empty collection if no errors were found.

Specified by:
getPromptValueValidationErrors in interface PromptDefinitionInterface
Overrides:
getPromptValueValidationErrors in class PromptDefinition
Parameters:
value - The value to check for errors
locale - The locale to return the error messages in
Returns:
A Collection containing the set of ValidationEntry objects or an empty collection if no errors were found.
See Also:
PromptDefinitionInterface.getPromptValueValidationErrors(Object, Locale)

validateDefinition

public java.util.Collection<ValidationEntry> validateDefinition(java.util.Locale locale)
This method is used to validate that the various attributes of the definition all contain valid values. If the definition is valid, and empty collection will be returned, otherwise the collection with contain ValidationEntry objects for each error. This method should be called before the definition is to be used. Subclasses should override this method to return the appropriate validation errors.

Specified by:
validateDefinition in interface PromptDefinitionInterface
Overrides:
validateDefinition in class PromptDefinition
Parameters:
locale - The locale to return the error messages in
Returns:
A Collection containing the set of ValidationEntry objects or an empty collection if no errors were found.
See Also:
PromptDefinitionInterface.validateDefinition(Locale)

getPromptDataType

public com.sas.datatypes.DataTypeInterface getPromptDataType()
Returns an instance of com.sas.datatypes.CollectionType or com.sas.datatypes.IntegerType that can be used to process values for this prompt.

Specified by:
getPromptDataType in interface PromptDefinitionInterface
Specified by:
getPromptDataType in class PromptDefinition
Returns:
an instance of com.sas.datatypes.CollectionType or com.sas.datatypes.IntegerType
See Also:
PromptDefinitionInterface.getPromptDataType()

getAttributeDescriptors

public java.util.List getAttributeDescriptors(java.util.Locale locale)
Specified by:
getAttributeDescriptors in interface com.sas.util.AttributeDescription
Overrides:
getAttributeDescriptors in class PromptDefinition

configureAttributes

public void configureAttributes(java.util.Map<java.lang.String,?> options,
                                java.util.Map<java.lang.String,?> context)
Specified by:
configureAttributes in interface com.sas.util.AttributeConfigurationInterface
Overrides:
configureAttributes in class PromptDefinition

isRequired

public boolean isRequired()
Description copied from class: PromptDefinition
Returns whether the prompt value is required to be set before the user can continue with the operation being prompted for.

Specified by:
isRequired in interface PromptDefinitionInterface
Specified by:
isRequired in class PromptDefinition
Returns:
whether the prompt value is required to be set.
See Also:
PromptDefinitionInterface.isRequired()

getMaximumValueCount

public int getMaximumValueCount()
Description copied from interface: SelectableDefinitionInterface
Returns the maximum number of values the user is allowed to select.

Specified by:
getMaximumValueCount in interface SelectableDefinitionInterface
Returns:
the maximum number of values the user is allowed to select

getMinimumValueCount

public int getMinimumValueCount()
Description copied from interface: SelectableDefinitionInterface
Returns the minimum number of values the user is allowed to select.

Specified by:
getMinimumValueCount in interface SelectableDefinitionInterface
Returns:
the minimum number of values the user is allowed to select

getSelectionType

public int getSelectionType()
Description copied from interface: SelectableDefinitionInterface
Returns the type of selection that the prompt supports. SINGLE_SELECTION indicates that the user will only be able to select 1 value at a time. MULTIPLE_SELECTION indicates that the user will be able to select multiple values (subject to the maximum value count). ORDERED_MULTIPLE_SELECTION indicates that the user will be able to select multiple values (subject to the maximum value count) and that they will be able to reorder the selected values.

Specified by:
getSelectionType in interface SelectableDefinitionInterface
Returns:
An integer corresponding to SINGLE_SELECTION, MULTIPLE_SELECTION, ORDERED_MULTIPLE_SELECTION

isSelectionOrdered

public boolean isSelectionOrdered()
Description copied from interface: SelectableDefinitionInterface
Returns whether the values the user selects should be ordered.

Specified by:
isSelectionOrdered in interface SelectableDefinitionInterface
Returns:
whether the values the user selects should be ordered.

setMaximumValueCount

public void setMaximumValueCount(int maximumValueCount)
Description copied from interface: MutableSelectableDefinitionInterface
Sets the maximum number of valid values for a prompt.

Specified by:
setMaximumValueCount in interface MutableSelectableDefinitionInterface
Parameters:
maximumValueCount - the maximum number of valid values for a prompt.

setMinimumValueCount

public void setMinimumValueCount(int minimumValueCount)
Description copied from interface: MutableSelectableDefinitionInterface
Sets the minimum number of valid values for a prompt.

Specified by:
setMinimumValueCount in interface MutableSelectableDefinitionInterface
Parameters:
minimumValueCount - the minimum number of valid values for a prompt.

setSelectionOrdered

public void setSelectionOrdered(boolean selectionOrdered)
Description copied from interface: MutableSelectableDefinitionInterface
Sets whether the order in which values are selected should be retained.

Specified by:
setSelectionOrdered in interface MutableSelectableDefinitionInterface
Parameters:
selectionOrdered - whether the order in which values are selected should be retained.

getValueProvider

public com.sas.storage.valueprovider.ValueProviderInterface getValueProvider()
Description copied from interface: ValueProviderDefinitionInterface
Returns the value provider to use to access possible values for the prompt.

Specified by:
getValueProvider in interface ValueProviderDefinitionInterface
Returns:
the value provider to use to access possible values for the prompt

isAllowUserValues

public boolean isAllowUserValues()
Specified by:
isAllowUserValues in interface com.sas.storage.valueprovider.AllowUserValuesInterface

setValueProvider

public void setValueProvider(com.sas.storage.valueprovider.ValueProviderInterface valueProvider)
Description copied from interface: MutableValueProviderDefinitionInterface
Sets the value provider which will be used to determine the set of possible values for the prompt. This may be a dynamic value provider which reads from a dataset, or is may be a StaticValueProvider which holds the possble set of values in memory.

Specified by:
setValueProvider in interface MutableValueProviderDefinitionInterface
Parameters:
valueProvider - the value provider which will be used to determine the set of possible values for the prompt.

setAllowUserValues

public void setAllowUserValues(boolean allowValues)
Description copied from interface: MutableValueProviderDefinitionInterface
Sets whether the user should be allowed to specify values in addition to those returned by the value provider.

Specified by:
setAllowUserValues in interface MutableValueProviderDefinitionInterface
Parameters:
allowValues - whether the user should be allowed to specify values in addition to those returned by the value provider.

getSupportedSpecialValues

public com.sas.util.SupportedSpecialValues getSupportedSpecialValues()
Specified by:
getSupportedSpecialValues in interface com.sas.util.SupportedSpecialValuesInterface

setSupportedSpecialValues

public void setSupportedSpecialValues(com.sas.util.SupportedSpecialValues specialValuesSupported)
Specified by:
setSupportedSpecialValues in interface com.sas.util.MutableSupportedSpecialValuesInterface

getConstraints

protected java.util.Map<java.lang.String,java.lang.String> getConstraints(java.util.Locale locale)
Overrides:
getConstraints in class PromptDefinition

setValueRetrieverConfiguration

public void setValueRetrieverConfiguration(com.sas.storage.vr.dto.ValueRetrieverConfiguration config)
Description copied from interface: MutableValueRetrieverDefinitionInterface
Sets the ValueRetrieverConfiguration instance.

Specified by:
setValueRetrieverConfiguration in interface com.sas.prompts.definitions.MutableValueRetrieverDefinitionInterface

getValueRetrieverConfiguration

public com.sas.storage.vr.dto.ValueRetrieverConfiguration getValueRetrieverConfiguration()
Description copied from interface: ValueRetrieverDefinitionInterface
Returns the ValueRetrieverConfiguration instance that was set, if any.

Specified by:
getValueRetrieverConfiguration in interface com.sas.prompts.definitions.ValueRetrieverDefinitionInterface
Returns:

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: PromptDefinition
Clone this PromptDefinition.

Specified by:
clone in interface com.sas.PublicClonable
Overrides:
clone in class PromptDefinition
Returns:
a clone of the prompt
Throws:
java.lang.CloneNotSupportedException

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface com.sas.models.VersionInterface
Overrides:
getVersion in class PromptDefinition

validIndividualValue

public boolean validIndividualValue(java.lang.Object value,
                                    java.util.Locale locale)
Description copied from interface: SelectableDefinitionV2Interface
Validates an individual value in a locale-specific way as appropriate. Locale may not be null.

Specified by:
validIndividualValue in interface com.sas.prompts.definitions.SelectableDefinitionV2Interface
Returns:



Copyright © 2009 SAS Institute Inc. All Rights Reserved.