com.sas.prompts.definitions
Class BaseDefinitionRange

com.sas.prompts.definitions.BaseDefinitionRange
All Implemented Interfaces:
com.sas.models.VersionInterface, com.sas.prompts.definitions.BaseDefinitionRangeInterface, com.sas.prompts.definitions.HintableDefinitionInterface, com.sas.prompts.definitions.HintableDefinitionV2Interface, com.sas.prompts.definitions.MutableBaseDefinitionRangeInterface, com.sas.prompts.definitions.MutableHintableDefinitionInterface, com.sas.prompts.definitions.MutableHintableDefinitionV2Interface, com.sas.prompts.definitions.MutablePromptDefinitionInterface, com.sas.prompts.definitions.MutablePromptDefinitionV2Interface, com.sas.prompts.definitions.MutablePromptDefinitionV3Interface, MutableRequiredDefinitionInterface, PromptDefinitionInterface, com.sas.prompts.definitions.PromptDefinitionV2Interface, com.sas.prompts.definitions.PromptDefinitionV3Interface, 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.uiconfig.ContextEnabledObject, com.sas.util.AttributeConfigurationInterface, com.sas.util.AttributeDescription, com.sas.util.log.ComponentLogFactoryInterface, com.sas.util.macrovar.MacroVariableOptionInterface, com.sas.util.macrovar.MutableMacroVariableOptionInterface, com.sas.util.ResourceReferencesInterface, com.sas.util.xmlpersist.PersistenceInterface, java.io.Externalizable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DateRangeDefinition, DoubleRangeDefinition, IntegerRangeDefinition, StringRangeDefinition

public abstract class BaseDefinitionRange
implements com.sas.prompts.definitions.MutableBaseDefinitionRangeInterface

Base class for range definitions. This class adds a required flag and labels for the min and max fields (which subclasses will provide) to the functionality provided by PromptDefinitionInterface.

See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Fields inherited from interface com.sas.prompts.definitions.PromptDefinitionInterface
PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM, PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM_DECIMAL_PLACES, PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM_LINES, PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM_VALUE_COUNT, PROMPT_VALIDATION_ERROR_BELOW_MINIMUM, PROMPT_VALIDATION_ERROR_BELOW_MINIMUM_LENGTH, PROMPT_VALIDATION_ERROR_BELOW_MINIMUM_VALUE_COUNT, PROMPT_VALIDATION_ERROR_DATA_SOURCE_COLUMN_TYPE_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_DATA_SOURCE_CONTAINS_NO_DATA_ITEMS, PROMPT_VALIDATION_ERROR_DATA_SOURCE_NOT_AVAILABLE, PROMPT_VALIDATION_ERROR_DATA_SOURCE_TYPE_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_EMPTY_STATIC_LIST_AND_REQUIRED_WITH_NO_ADDITIONAL_VALUES_ALLOWED, PROMPT_VALIDATION_ERROR_ERROR_LOADING_SHARED_PROMPT, PROMPT_VALIDATION_ERROR_FILE_TYPE_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_FROM_SCRIPT, PROMPT_VALIDATION_ERROR_INCORRECT_RELATIVE_DATE_VALUE, PROMPT_VALIDATION_ERROR_INPUT_DOES_NOT_MATCH_PATTERN, PROMPT_VALIDATION_ERROR_INVALID_INPUT_PATTERN, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_ABOVE_MAXIMUM, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_ABOVE_UPPER_RANGE_VALUE, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_BELOW_MINIMUM, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_BELOW_MINIMUM_LENGTH, PROMPT_VALIDATION_ERROR_MASKED_HIDDEN_REQUIRED, PROMPT_VALIDATION_ERROR_MAX_DECIMAL_PLACES_ABOVE_MAX_PERCISION, PROMPT_VALIDATION_ERROR_MAXIMUM_LENGTH_BELOW_ZERO, PROMPT_VALIDATION_ERROR_MIN_DECIMAL_PLACES_ABOVE_MAX_PERCISION, PROMPT_VALIDATION_ERROR_MINIMUM_ABOVE_MAXIMUM, PROMPT_VALIDATION_ERROR_MINIMUM_ABOVE_MAXIMUM_DECIMAL_PLACES, PROMPT_VALIDATION_ERROR_MINIMUM_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_MINIMUM_ABOVE_MAXIMUM_VALUE_COUNT, PROMPT_VALIDATION_ERROR_MINIMUM_LENGTH_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_MINIMUM_LENGTH_BELOW_ZERO, PROMPT_VALIDATION_ERROR_MORE_THAN_ONE_SPECIAL_VALUE_SPECIFIED, PROMPT_VALIDATION_ERROR_MULTIPLE_DATA_SOURCES_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_NO_DATA_SOURCE, PROMPT_VALIDATION_ERROR_NON_EDITABLE_REQUIRED_WITH_NO_DEFAULT_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_NOT_VALID_OBJECT, PROMPT_VALIDATION_ERROR_ONLY_DIRECTORIES_ALLOWED, PROMPT_VALIDATION_ERROR_ONLY_FILES_ALLOWED, PROMPT_VALIDATION_ERROR_PERIOD_ENDS_200_YEARS_AHEAD, PROMPT_VALIDATION_ERROR_PERIOD_STARTS_200_YEARS_AGO, PROMPT_VALIDATION_ERROR_SPECIAL_VALUE_MIXED_WITH_OTHER_VALUES, PROMPT_VALIDATION_ERROR_STATIC_VALUE_INVALID, PROMPT_VALIDATION_ERROR_UPPER_RANGE_VALUE_ABOVE_MAXIMUM, PROMPT_VALIDATION_ERROR_UPPER_RANGE_VALUE_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_UPPER_RANGE_VALUE_BELOW_MINIMUM, PROMPT_VALIDATION_ERROR_UPPER_RANGE_VALUE_BELOW_MINIMUM_LENGTH, PROMPT_VALIDATION_NO_ERRORS
 
Constructor Summary
BaseDefinitionRange()
          Constructor
BaseDefinitionRange(java.lang.String promptName)
          Constructor
 
Method Summary
 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.lang.String getDefaultMaxLabel(java.util.Locale locale)
          Returns the default label for the maximum field when one is not set by the user.
protected  java.lang.String getDefaultMinLabel(java.util.Locale locale)
          Returns the default label for the minimum field when one is not set by the user.
 java.lang.String getMaxLabel(java.util.Locale locale)
          Returns the label for the maximum field for the given locale.
 com.sas.util.LocalizableString getMaxLabels()
          Returns a LocalizableString which contains all max labels for the prompt.
 java.lang.String getMinLabel(java.util.Locale locale)
          Returns the label for the minimum field for the given locale.
 com.sas.util.LocalizableString getMinLabels()
          Returns a LocalizableString which contains all min labels for the prompt.
 boolean isRequired()
          Returns whether the user is required to enter a value for this prompt before continuing.
protected  java.util.Collection<ValidationEntry> populateErrorsForMinMax(java.util.Collection<ValidationEntry> errors, long errorCode, boolean defaultValue, java.util.Locale locale, java.lang.Object value, java.lang.Object minValue, java.lang.Object maxValue)
           
protected  java.util.Collection<ValidationEntry> populateMapWithErrorsForValue(java.util.Collection<ValidationEntry> errors, long errorCode, java.lang.Object value, boolean defaultValue, java.util.Locale locale)
           
 void setMaxLabel(java.lang.String maxLabelValue, java.util.Locale locale)
          Sets the label for the maximum field for the given locale.
 void setMaxLabels(com.sas.util.LocalizableString labels)
          Sets a LocalizableString containing the localized max labels for the prompt.
 void setMinLabel(java.lang.String minLabelValue, java.util.Locale locale)
          Sets the label for the minimum field for the given locale.
 void setMinLabels(com.sas.util.LocalizableString labels)
          Sets a LocalizableString containing the localized min labels for the prompt.
 void setRequired(boolean required)
          Sets whether the user is required to enter a value for this prompt before continuing.
 
Methods inherited from class com.sas.prompts.definitions.PromptDefinition
addUserInfo, clearDefaultValue, getApplicationContext, getConstraints, getCustomErrorMessage, getCustomErrorMessages, getDefaultValue, getDependentPromptsForAttributes, getHint, getHintPlacement, getHints, getInlineHint, getInlineHints, getLabelPlacement, getLocalizableProperties, getMutableUserInfo, getPromptDataType, getPromptDescription, getPromptDescriptions, getPromptHelp, getPromptID, getPromptLabel, getPromptLabels, getPromptName, getPromptValueValidationErrors, getScript, getScripts, getUIConfiguration, getUserInfo, getUserInfoAsText, getVersion, isDefaultValueSet, isDisplayDefaultValueAsBlank, isFixed, isHidden, isPromptValueValid, 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, validateDefinition
 
Methods inherited from interface com.sas.prompts.definitions.PromptDefinitionInterface
clearDefaultValue, getDefaultValue, getPromptDataType, getPromptDescription, getPromptDescriptions, getPromptLabel, getPromptLabels, getPromptName, getPromptValueValidationErrors, getUserInfo, isDefaultValueSet, isFixed, isHidden, isPromptValueValid, validateDefinition
 

Field Detail

RB_KEY

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

BaseDefinitionRange

public BaseDefinitionRange()
Constructor


BaseDefinitionRange

public BaseDefinitionRange(java.lang.String promptName)
Constructor

Parameters:
promptName - The name of the prompt
Method Detail

getMaxLabel

public java.lang.String getMaxLabel(java.util.Locale locale)
Returns the label for the maximum field for the given locale.

Specified by:
getMaxLabel in interface com.sas.prompts.definitions.BaseDefinitionRangeInterface
Returns:
the label for the maximum field for the given locale.

getMaxLabels

public com.sas.util.LocalizableString getMaxLabels()
Returns a LocalizableString which contains all max labels for the prompt.

Returns:
a LocalizableString which contains all max labels for the prompt.

setMaxLabel

public void setMaxLabel(java.lang.String maxLabelValue,
                        java.util.Locale locale)
Sets the label for the maximum field for the given locale.

Specified by:
setMaxLabel in interface com.sas.prompts.definitions.MutableBaseDefinitionRangeInterface
Parameters:
maxLabelValue - the label for the maximum field for the given locale.
locale - The locale to set the label for

setMaxLabels

public void setMaxLabels(com.sas.util.LocalizableString labels)
Sets a LocalizableString containing the localized max labels for the prompt. The LocalizableString passed in is cloned by the prompt.

Parameters:
labels - a LocalizableString containing the localized max labels for the prompt.

getMinLabel

public java.lang.String getMinLabel(java.util.Locale locale)
Returns the label for the minimum field for the given locale.

Specified by:
getMinLabel in interface com.sas.prompts.definitions.BaseDefinitionRangeInterface
Returns:
the label for the minimum field for the given locale.

getMinLabels

public com.sas.util.LocalizableString getMinLabels()
Returns a LocalizableString which contains all min labels for the prompt.

Returns:
a LocalizableString which contains all min labels for the prompt.

getDefaultMaxLabel

protected java.lang.String getDefaultMaxLabel(java.util.Locale locale)
Returns the default label for the maximum field when one is not set by the user.

Parameters:
locale - The locale the retrieve the label for
Returns:
the default label for the maximum field when one is not set by the user.

getDefaultMinLabel

protected java.lang.String getDefaultMinLabel(java.util.Locale locale)
Returns the default label for the minimum field when one is not set by the user.

Parameters:
locale - The locale the retrieve the label for
Returns:
the default label for the minimum field when one is not set by the user.

setMinLabel

public void setMinLabel(java.lang.String minLabelValue,
                        java.util.Locale locale)
Sets the label for the minimum field for the given locale.

Specified by:
setMinLabel in interface com.sas.prompts.definitions.MutableBaseDefinitionRangeInterface
Parameters:
maxLabelValue - the label for the minimum field for the given locale.
locale - The locale to set the label for

setMinLabels

public void setMinLabels(com.sas.util.LocalizableString labels)
Sets a LocalizableString containing the localized min labels for the prompt. The LocalizableString passed in is cloned by the prompt.

Parameters:
labels - a LocalizableString containing the localized min labels for the prompt.

isRequired

public boolean isRequired()
Returns whether the user is required to enter a value for this prompt before continuing.

Specified by:
isRequired in interface com.sas.prompts.definitions.BaseDefinitionRangeInterface
Specified by:
isRequired in interface PromptDefinitionInterface
Specified by:
isRequired in class PromptDefinition
Returns:
whether the user is required to enter a value for this prompt before continuing.
See Also:
PromptDefinitionInterface.isRequired()

setRequired

public void setRequired(boolean required)
Sets whether the user is required to enter a value for this prompt before continuing.

Specified by:
setRequired in interface MutableRequiredDefinitionInterface
Parameters:
required - whether the user is required to enter a value for this prompt before continuing.

populateMapWithErrorsForValue

protected java.util.Collection<ValidationEntry> populateMapWithErrorsForValue(java.util.Collection<ValidationEntry> errors,
                                                                              long errorCode,
                                                                              java.lang.Object value,
                                                                              boolean defaultValue,
                                                                              java.util.Locale locale)

populateErrorsForMinMax

protected java.util.Collection<ValidationEntry> populateErrorsForMinMax(java.util.Collection<ValidationEntry> errors,
                                                                        long errorCode,
                                                                        boolean defaultValue,
                                                                        java.util.Locale locale,
                                                                        java.lang.Object value,
                                                                        java.lang.Object minValue,
                                                                        java.lang.Object maxValue)

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

getAttributeDescriptors

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



Copyright © 2009 SAS Institute Inc. All Rights Reserved.