com.sas.prompts
Class PromptValues

com.sas.prompts.PromptValues
All Implemented Interfaces:
com.sas.models.VersionInterface, PromptValuesInterface, com.sas.util.log.ComponentLogFactoryInterface, com.sas.util.xmlpersist.PersistenceInterface, java.io.Externalizable, java.io.Serializable

public class PromptValues
implements PromptValuesInterface

PromptValues is the default implementation of the PromptValuesInterface. It fully implements the interface with a Map-based storage or the prompt values. The purpose of the PromptValues object is to hold the current values of the prompts in a PromptGroup.

See Also:
PromptValuesInterface, PromptGroupInterface, PromptGroup, Serialized Form

Field Summary
static java.lang.String _SAS_INTERNAL_ORDER_UNIMPORTANT
          This flag is used for user info set on the prompt values object.
static java.lang.String PROMPT_VALUES_XML_WRITE_ALL_DEFINITIONS
           
static java.lang.String RB_KEY
           
static java.lang.String UNSET
           
 
Constructor Summary
PromptValues()
          Constructs a PromptValues object which is associated with an empty PromptGroup.
PromptValues(java.util.List promptDefinitions, com.sas.prompts.PromptUserContextInterface userContext)
          Constructs a PromptValues object which is associated with a new PromptGroup containing the specified PromptDefinitions.
PromptValues(PromptGroupInterface promptGroup)
          Constructs a PromptValues object which is associated with the specified PromptGroup.
PromptValues(PromptGroupInterface promptGroup, com.sas.prompts.PromptUserContextInterface userContext)
          Constructs a PromptValues object which is associated with the specified PromptGroup.
 
Method Summary
 void acceptPromptValuesVisitor(PromptValuesVisitorInterface visitor)
          Accept method for visitor object (see visitor pattern) which passes the visitor on to any delegate PromptValues objects.
 void addPromptValueChangeListener(PromptValueChangeListener listener)
          Adds a listener which is notified when a prompt value changes.
 void addPromptValuesDelegate(PromptValuesInterface promptValues)
          Adds a PromptValuesInterface as a delegate to this PromptValues.
 void clearPromptValue(PromptDefinitionInterface promptDefinition)
          Clears a prompt value which has previously been set.
 void clearPromptValuesDelegates()
          Removes all delegates from this PromptValues.
 void consumeAttributes(com.sas.util.xmlpersist.AttributesProvider provider)
          Internal persistence method
 void consumeRelatedObjects(com.sas.util.xmlpersist.RelatedObjectListsHolder roHolder)
          Internal persistence method
 PromptValuesInterface findPromptValuesForPromptDefinition(PromptDefinitionInterface promptDefinition)
          Recursively finds the PromptValues object which holds the PromptGroup which contains the specified PromptDefinition.
protected  void getAllWritableValues(java.util.List allDefinitionReferences)
          Internal persistence method
 java.lang.String getDefinitionElementName()
          Internal persistence method
 com.sas.util.MutableUserInfoInterface getMutableUserInfo()
          Returns a MutableUserInfoInterface implementation which can be used by creators and consumers of PromptValues to store custom information on the PromptValues object.
 PromptDefinitionInterface getPromptDefinition(java.lang.String promptName, boolean recursive)
          Returns the PromptDefinition of the given name from the PromptGroup held by the PromptValues object.
 PromptGroupInterface getPromptGroup()
          Returns the prompt group associated with this PromptValues object which defines the prompts and constraints.
 com.sas.prompts.PromptUserContextInterface getPromptUserContext()
          Returns the user context used to store sticky default values.
 java.lang.Object getPromptValue(PromptDefinitionInterface promptDefinition)
          Returns the current value of the prompt if there is one.
 java.util.Date getPromptValueAsDate(PromptDefinitionInterface promptDefinition)
          Return a prompt value as a Date.
 double getPromptValueAsDouble(PromptDefinitionInterface promptDefinition)
          Return a prompt value as a double.
 int getPromptValueAsInt(PromptDefinitionInterface promptDefinition)
          Return a prompt value as an int.
 java.util.List getPromptValueAsList(PromptDefinitionInterface promptDefinition)
          Return a prompt value as a List.
 java.lang.String getPromptValueAsString(PromptDefinitionInterface promptDefinition)
          Return a prompt value as a String.
 java.lang.String getPromptValueAsString(PromptDefinitionInterface promptDefinition, java.util.Locale locale)
          Returns a localized string representation of the specified prompt value.
 PromptValueChangeListener[] getPromptValueChangeListeners()
          Returns an array of all the PromptValueChangeListeners added to this PromptValues with addPromptValuesChangeListener().
 java.util.Map getPromptValues()
          Returns a Map of all the prompt definitions to their values.
 java.util.Map getPromptValues(PromptGroupInterface promptGroup, boolean recursive, boolean includeDefaultAndStickyValues)
          TBD This method is not implemented and always returns null.
 java.util.List getPromptValuesDelegates()
          Returns a list of delegates for the PromptValues.
protected  java.util.List getWritableCombinations()
          Internal persistence method
protected  java.util.List getWritableValues()
          Internal persistence method
 void init(java.util.Map options)
          When called, this method will check all the definitions that have a value provider that implement the ValueProviderInitializationInterface and will call initialize method on each value provider with the options passed in.
 boolean isAllPromptValuesValid()
          Returns whether the current value of all prompts are valid.
 boolean isAllRequiredPromptsValid()
          Returns whether the current value of all required prompts are valid.
 boolean isPromptValueAvailable(PromptDefinitionInterface promptDefinition)
          Returns true is the prompt has either a value set, a sticky value or a default value, false otherwise.
 boolean isPromptValueMissing(PromptDefinitionInterface promptDefinition)
          Returns whether the specified prompt value is a missing value.
 boolean isPromptValueSet(PromptDefinitionInterface promptDefinition)
          Returns whether the prompt value is set.
 boolean isPromptValueValid(PromptDefinitionInterface promptDefinition)
          Returns whether the current value of the specified prompt is valid.
 void removePromptValueChangeListener(PromptValueChangeListener listener)
          Removes a listener previously added with addPromptValueChangeListener.
 void removePromptValuesDelegate(PromptValuesInterface promptValues)
          Removes a PromptValuesInterface as a delegate from this PromptValues.
 void setInitParameter(java.lang.String key, java.lang.Object value)
          When called, this method will check all the definitions that have a value provider that implement the ValueProviderInitializationInterface and will call initialize method on each value provider with the key-value pair passed in.
 void setPromptGroup(PromptGroupInterface promptGroup, boolean clearValuesNotInGroup)
          Sets the PromptGroup associated with this PromptValues object.
 void setPromptValue(PromptDefinitionInterface promptDefinition, java.util.Date value)
          Sets the prompt value to a date value.
 void setPromptValue(PromptDefinitionInterface promptDefinition, double value)
          Sets the prompt value to a double value.
 void setPromptValue(PromptDefinitionInterface promptDefinition, int value)
          Sets the prompt value to an integer value.
 void setPromptValue(PromptDefinitionInterface promptDefinition, java.util.List value)
          Sets the prompt value to a collection of values.
 void setPromptValue(PromptDefinitionInterface promptDefinition, java.lang.Object value)
          Sets the prompt value.
 void setPromptValue(PromptDefinitionInterface promptDefinition, java.lang.Object value, java.util.Locale inputLocale)
          Sets the value for the prompt.
 void setPromptValue(PromptDefinitionInterface promptDefinition, java.lang.String value)
          Sets the prompt value to a String value.
 void setPromptValues(java.util.Map definitionToValueMap, java.util.Locale inputLocale)
          Sets one or more of prompt values at the same time.
protected  void writeDefinition(org.w3c.dom.Element element, com.sas.util.xmlpersist.PromptsWritingContext writingContext)
          Internal persistence method
 

Field Detail

RB_KEY

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

PROMPT_VALUES_XML_WRITE_ALL_DEFINITIONS

public static final java.lang.String PROMPT_VALUES_XML_WRITE_ALL_DEFINITIONS
See Also:
Constant Field Values

_SAS_INTERNAL_ORDER_UNIMPORTANT

public static final java.lang.String _SAS_INTERNAL_ORDER_UNIMPORTANT
This flag is used for user info set on the prompt values object. It is internal only and is to be used to basically state that the order of the prompts in the attached prompt group is not important and can be changed if needed or wanted.

See Also:
Constant Field Values

UNSET

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

PromptValues

public PromptValues()
Constructs a PromptValues object which is associated with an empty PromptGroup.


PromptValues

public PromptValues(PromptGroupInterface promptGroup)
Constructs a PromptValues object which is associated with the specified PromptGroup.

Parameters:
promptGroup - The PromptGroup to associate with this PromptValues.

PromptValues

public PromptValues(PromptGroupInterface promptGroup,
                    com.sas.prompts.PromptUserContextInterface userContext)
Constructs a PromptValues object which is associated with the specified PromptGroup.

Parameters:
promptGroup - The PromptGroup to associate with this PromptValues.
userContext - May be null. This parameter is currently not used.

PromptValues

public PromptValues(java.util.List promptDefinitions,
                    com.sas.prompts.PromptUserContextInterface userContext)
Constructs a PromptValues object which is associated with a new PromptGroup containing the specified PromptDefinitions.

Parameters:
promptDefinitions - A List of PromptDefinitions to create a PromptGroup with.
userContext - May be null. This parameter is currently not used.
Method Detail

init

public void init(java.util.Map options)
When called, this method will check all the definitions that have a value provider that implement the ValueProviderInitializationInterface and will call initialize method on each value provider with the options passed in.

Specified by:
init in interface PromptValuesInterface
Parameters:
options - a map of options, see the ValueProviderInitializationInterface for more details

setInitParameter

public void setInitParameter(java.lang.String key,
                             java.lang.Object value)
When called, this method will check all the definitions that have a value provider that implement the ValueProviderInitializationInterface and will call initialize method on each value provider with the key-value pair passed in. The key-value pairs are not held onto, so if this method is called more then once, the initialize method on the value providers will only get passed the current key-value pair, so if more then one param is needed, either use the init(Map) method or the value provider needs to handle initialize being called more then once.

Specified by:
setInitParameter in interface PromptValuesInterface
Parameters:
key -
value -

getPromptGroup

public PromptGroupInterface getPromptGroup()
Returns the prompt group associated with this PromptValues object which defines the prompts and constraints.

Specified by:
getPromptGroup in interface PromptValuesInterface
Returns:
The prompt definition group associated with this PromptValues object which defines the prompts and constraints.
See Also:
PromptValuesInterface.getPromptGroup()

setPromptGroup

public void setPromptGroup(PromptGroupInterface promptGroup,
                           boolean clearValuesNotInGroup)
Sets the PromptGroup associated with this PromptValues object. Optionally, it will clear the value of all PromptDefinitions previously set on the PromptValues which are not in the new PromptGroup.

Specified by:
setPromptGroup in interface PromptValuesInterface
Parameters:
promptGroup - The PromptGroup associated with this PromptValues object
clearValuesNotInGroup - Whether to clear the value of all PromptDefinitions previously set on the PromptValues which are not in the new PromptGroup.
See Also:
getPromptGroup()

getPromptUserContext

public com.sas.prompts.PromptUserContextInterface getPromptUserContext()
Returns the user context used to store sticky default values. This can be set when the PromptValues object is created.

Returns:
The user context used to store sticky default values.

getPromptValue

public java.lang.Object getPromptValue(PromptDefinitionInterface promptDefinition)
                                throws PromptValueNotFoundException
Returns the current value of the prompt if there is one. If there is no value, it checks for a sticky value. If there is no sticky value, it checks for a default value. If no default value is found, a PromptValueNotFoundException is thrown.

Specified by:
getPromptValue in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to return the value of.
Returns:
An Object representing the prompt's value
Throws:
PromptValueNotFoundException
See Also:
PromptValuesInterface.getPromptValue(PromptDefinitionInterface)

getPromptValueAsInt

public int getPromptValueAsInt(PromptDefinitionInterface promptDefinition)
                        throws PromptValueNotFoundException
Return a prompt value as an int. If the prompt value is not an Integer (as returned by getPromptValue()), a ClassCastException will be thrown.

Specified by:
getPromptValueAsInt in interface PromptValuesInterface
Parameters:
promptDefinition - The definition to return the value of
Returns:
The prompt value
Throws:
PromptValueNotFoundException

getPromptValueAsDouble

public double getPromptValueAsDouble(PromptDefinitionInterface promptDefinition)
                              throws PromptValueNotFoundException
Return a prompt value as a double. If the prompt value is not a Double (as returned by getPromptValue()), a ClassCastException will be thrown.

Specified by:
getPromptValueAsDouble in interface PromptValuesInterface
Parameters:
promptDefinition - The definition to return the value of
Returns:
The prompt value
Throws:
PromptValueNotFoundException

getPromptValueAsString

public java.lang.String getPromptValueAsString(PromptDefinitionInterface promptDefinition)
                                        throws PromptValueNotFoundException
Return a prompt value as a String. If the prompt value is not a String (as returned by getPromptValue()), a ClassCastException will be thrown.

Specified by:
getPromptValueAsString in interface PromptValuesInterface
Parameters:
promptDefinition - The definition to return the value of
Returns:
The prompt value
Throws:
PromptValueNotFoundException

getPromptValueAsDate

public java.util.Date getPromptValueAsDate(PromptDefinitionInterface promptDefinition)
                                    throws PromptValueNotFoundException
Return a prompt value as a Date. If the prompt value is not a Date (as returned by getPromptValue()), a ClassCastException will be thrown.

Specified by:
getPromptValueAsDate in interface PromptValuesInterface
Parameters:
promptDefinition - The definition to return the value of
Returns:
The prompt value
Throws:
PromptValueNotFoundException

getPromptValueAsList

public java.util.List getPromptValueAsList(PromptDefinitionInterface promptDefinition)
                                    throws PromptValueNotFoundException
Return a prompt value as a List. If the prompt value is not a List (as returned by getPromptValue(PromptDefinitionInterface)), the value will be wrapped in a List and returned.

Specified by:
getPromptValueAsList in interface PromptValuesInterface
Parameters:
promptDefinition - The definition to return the value of
Returns:
The prompt value
Throws:
PromptValueNotFoundException

isPromptValueMissing

public boolean isPromptValueMissing(PromptDefinitionInterface promptDefinition)
                             throws PromptValueNotFoundException
Returns whether the specified prompt value is a missing value.

Parameters:
promptDefinition - The definition to check for a missing value
Returns:
true if the prompt value represents a missing value
Throws:
PromptValueNotFoundException

setPromptValue

public void setPromptValue(PromptDefinitionInterface promptDefinition,
                           java.util.List value)
                    throws InvalidPromptValueException
Sets the prompt value to a collection of values.

Specified by:
setPromptValue in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to set the value of
value - The new value of the prompt
Throws:
InvalidPromptValueException
See Also:
PromptValuesInterface.setPromptValue(PromptDefinitionInterface, List)

setPromptValue

public void setPromptValue(PromptDefinitionInterface promptDefinition,
                           java.lang.String value)
                    throws InvalidPromptValueException
Sets the prompt value to a String value.

Specified by:
setPromptValue in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to set the value of
value - The new value of the prompt
Throws:
InvalidPromptValueException
See Also:
PromptValuesInterface.setPromptValue(PromptDefinitionInterface, String)

setPromptValue

public void setPromptValue(PromptDefinitionInterface promptDefinition,
                           java.util.Date value)
                    throws InvalidPromptValueException
Sets the prompt value to a date value.

Specified by:
setPromptValue in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to set the value of
value - The new value of the prompt
Throws:
InvalidPromptValueException
See Also:
PromptValuesInterface.setPromptValue(PromptDefinitionInterface, Date)

setPromptValue

public void setPromptValue(PromptDefinitionInterface promptDefinition,
                           double value)
                    throws InvalidPromptValueException
Sets the prompt value to a double value.

Specified by:
setPromptValue in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to set the value of
value - The new value of the prompt
Throws:
InvalidPromptValueException
See Also:
PromptValuesInterface.setPromptValue(PromptDefinitionInterface, double)

setPromptValue

public void setPromptValue(PromptDefinitionInterface promptDefinition,
                           int value)
                    throws InvalidPromptValueException
Sets the prompt value to an integer value.

Parameters:
promptDefinition - The prompt to set the value of
value - The new value of the prompt
Throws:
InvalidPromptValueException
See Also:
com.sas.prompts.PromptValuesInterface#setPromptValue(PromptDefinitionInterface, int)

setPromptValue

public void setPromptValue(PromptDefinitionInterface promptDefinition,
                           java.lang.Object value)
                    throws InvalidPromptValueException
Sets the prompt value.

Specified by:
setPromptValue in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to set the value of
value - The new value of the prompt
Throws:
InvalidPromptValueException
See Also:
PromptValuesInterface.setPromptValue(PromptDefinitionInterface, Object)

setPromptValue

public void setPromptValue(PromptDefinitionInterface promptDefinition,
                           java.lang.Object value,
                           java.util.Locale inputLocale)
                    throws InvalidPromptValueException
Sets the value for the prompt. If the value is null, the clearPromptValue(PromptDefinitionInterface) method will get called. If the prompt definition is the definition associated with the ModalGroupInterface, then all prompt definitions on each ModalChoiceGroupInterface will get their value cleared. If the value for the prompt is invalid, an InvalidPromptValueException will be thrown. #setPromptValueValid(PromptDefinitionInterface, boolean, Map) will get called with a true paramter if the value is valid, false otherwise. A PromptValudChangeEvent will be thrown after the value has been set.

Specified by:
setPromptValue in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to set the value of
value - The new value of the prompt, null to clear the value for the prompt
inputLocale - The locale that the prompt value was input in
Throws:
InvalidPromptValueException - Will be thrown if the value for the prompt is invalid for any reason
java.lang.IllegalArgumentException - Will be thrown if the prompt values object that contains the given prompt definition cannot be found.
See Also:
PromptValuesInterface.setPromptValue(PromptDefinitionInterface, Object, Locale)

getPromptValueAsString

public java.lang.String getPromptValueAsString(PromptDefinitionInterface promptDefinition,
                                               java.util.Locale locale)
                                        throws PromptValueNotFoundException
Returns a localized string representation of the specified prompt value.

Specified by:
getPromptValueAsString in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to return the value of
locale - The locale to format the value to
Returns:
a localized string representation of the specified prompt value.
Throws:
PromptValueNotFoundException
See Also:
PromptValuesInterface.getPromptValueAsString(PromptDefinitionInterface, Locale)

isPromptValueSet

public boolean isPromptValueSet(PromptDefinitionInterface promptDefinition)
Returns whether the prompt value is set. Sticky default values and default values are ignored when making the determination.

Specified by:
isPromptValueSet in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to check for a value
Returns:
whether the prompt value is set
See Also:
clearPromptValue

isPromptValueAvailable

public boolean isPromptValueAvailable(PromptDefinitionInterface promptDefinition)
Returns true is the prompt has either a value set, a sticky value or a default value, false otherwise.

Specified by:
isPromptValueAvailable in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to query whether its value is available
Returns:
true is a value is availabel, false otherwise
See Also:
PromptValuesInterface.isPromptValueAvailable(PromptDefinitionInterface)

clearPromptValue

public void clearPromptValue(PromptDefinitionInterface promptDefinition)
Clears a prompt value which has previously been set. If the value has not previously been set, no action is taken.

Specified by:
clearPromptValue in interface PromptValuesInterface
Parameters:
promptDefinition - The prompt to clear the value of
See Also:
PromptValuesInterface.clearPromptValue(PromptDefinitionInterface)

getPromptValues

public java.util.Map getPromptValues(PromptGroupInterface promptGroup,
                                     boolean recursive,
                                     boolean includeDefaultAndStickyValues)
TBD This method is not implemented and always returns null.

Specified by:
getPromptValues in interface PromptValuesInterface
Parameters:
promptGroup - PromptGroupInterface
recursive - boolean
includeDefaultAndStickyValues - boolean
Returns:
Map
See Also:
PromptValuesInterface.getPromptValues(PromptGroupInterface, boolean, boolean)

getPromptValues

public java.util.Map getPromptValues()
Returns a Map of all the prompt definitions to their values. The prompt group is recursively checked for values. Delegates are not checked.

Specified by:
getPromptValues in interface PromptValuesInterface
Returns:
a Map of all the prompt definitions to their values.
See Also:
PromptValuesInterface.getPromptValues()

setPromptValues

public void setPromptValues(java.util.Map definitionToValueMap,
                            java.util.Locale inputLocale)
                     throws InvalidPromptValueException
Sets one or more of prompt values at the same time. Note that the order in which values are set may make a difference if ModalGroups are used.

Specified by:
setPromptValues in interface PromptValuesInterface
Parameters:
definitionToValueMap - A Map containing the PromptDefinitionInterface and values of the prompts to set the value of.
inputLocale - The locale that the values were entered in.
Throws:
InvalidPromptValueException
See Also:
PromptValuesInterface.setPromptValues(Map, Locale)

getMutableUserInfo

public com.sas.util.MutableUserInfoInterface getMutableUserInfo()
Returns a MutableUserInfoInterface implementation which can be used by creators and consumers of PromptValues to store custom information on the PromptValues object.

Specified by:
getMutableUserInfo in interface PromptValuesInterface
Returns:
a MutableUserInfoInterface which can be user to get/set user info
See Also:
com.sas.prompts.definitions.PromptDefinitionInterface#getMutableUserInfo()

addPromptValueChangeListener

public void addPromptValueChangeListener(PromptValueChangeListener listener)
Adds a listener which is notified when a prompt value changes. The listener will be added to any delegates to the PromptValues object as well.

Specified by:
addPromptValueChangeListener in interface PromptValuesInterface
Parameters:
listener - This listener to receive the event
See Also:
PromptValuesInterface.addPromptValueChangeListener(PromptValueChangeListener)

removePromptValueChangeListener

public void removePromptValueChangeListener(PromptValueChangeListener listener)
Removes a listener previously added with addPromptValueChangeListener. If the listener has not previously been added, no action is taken. The listener will be removed from any delegates to the PromptValues object as well.

Specified by:
removePromptValueChangeListener in interface PromptValuesInterface
Parameters:
listener - The listener which will no longer receive the event
See Also:
PromptValuesInterface.removePromptValueChangeListener(PromptValueChangeListener)

getPromptValueChangeListeners

public PromptValueChangeListener[] getPromptValueChangeListeners()
Returns an array of all the PromptValueChangeListeners added to this PromptValues with addPromptValuesChangeListener().

Specified by:
getPromptValueChangeListeners in interface PromptValuesInterface
Returns:
all of the PromptValueChangeListeners added or an empty array if no listeners have been added

isPromptValueValid

public boolean isPromptValueValid(PromptDefinitionInterface promptDefinition)
Returns whether the current value of the specified prompt is valid. The constraints of the prompt definition are checked as well as the required flag for the prompt.

Specified by:
isPromptValueValid in interface PromptValuesInterface
Parameters:
The - prompt whose value should be checked for validity
Returns:
whether the current value of the specified prompt is valid
See Also:
PromptValuesInterface.isPromptValueValid(PromptDefinitionInterface)

isAllPromptValuesValid

public boolean isAllPromptValuesValid()
Returns whether the current value of all prompts are valid. Delegate prompt values are not checked.

Specified by:
isAllPromptValuesValid in interface PromptValuesInterface
Returns:
whether the current value of all prompts are valid
See Also:
PromptValuesInterface.isAllPromptValuesValid()

isAllRequiredPromptsValid

public boolean isAllRequiredPromptsValid()
Returns whether the current value of all required prompts are valid. Delegate prompt values are not checked.

Specified by:
isAllRequiredPromptsValid in interface PromptValuesInterface
Returns:
whether the current value of all required prompts are valid
See Also:
PromptValuesInterface.isAllRequiredPromptsValid()

getPromptDefinition

public PromptDefinitionInterface getPromptDefinition(java.lang.String promptName,
                                                     boolean recursive)
Returns the PromptDefinition of the given name from the PromptGroup held by the PromptValues object. Delegate PromptValues objects are searched regardless of the value of the recursive flag.

Specified by:
getPromptDefinition in interface PromptValuesInterface
Parameters:
promptName - The name of the prompt to return the PromptDefinition for.
recursive - Whether to search subgroups for the specified prompt.
Returns:
The first prompt found with the specified name
See Also:
com.sas.prompts.PromptValuesInterface#getPromptDefinition(String)

clearPromptValuesDelegates

public void clearPromptValuesDelegates()
Removes all delegates from this PromptValues.

Specified by:
clearPromptValuesDelegates in interface PromptValuesInterface

addPromptValuesDelegate

public void addPromptValuesDelegate(PromptValuesInterface promptValues)
Adds a PromptValuesInterface as a delegate to this PromptValues. A delegate is an additional PromptValuesInterface which will be used to search for and store prompt values. Delegates are a convenient way to combine and layer prompt groups and keep their values in a separate PromptValues object for each prompt group.

Specified by:
addPromptValuesDelegate in interface PromptValuesInterface
Parameters:
promptValues - The delegate to also use to store and retrieve values from.
See Also:
PromptValuesInterface.addPromptValuesDelegate(PromptValuesInterface)

removePromptValuesDelegate

public void removePromptValuesDelegate(PromptValuesInterface promptValues)
Removes a PromptValuesInterface as a delegate from this PromptValues.

Specified by:
removePromptValuesDelegate in interface PromptValuesInterface
Parameters:
promptValues - The delegate to no longer store and retrieve values from
See Also:
com.sas.prompts.PromptValuesInterface#removePromptValuesDelegate(PromptValues)

getPromptValuesDelegates

public java.util.List getPromptValuesDelegates()
Returns a list of delegates for the PromptValues. null or an empty list will be returned if there are no delegates.

Specified by:
getPromptValuesDelegates in interface PromptValuesInterface
Returns:
a list of delegates for the PromptValues.
See Also:
PromptValuesInterface.getPromptValuesDelegates()

findPromptValuesForPromptDefinition

public PromptValuesInterface findPromptValuesForPromptDefinition(PromptDefinitionInterface promptDefinition)
Recursively finds the PromptValues object which holds the PromptGroup which contains the specified PromptDefinition. The returned PromptValues will either be the PromptValues this method is called on, a delegate, a descendent to a delegate, or null.

Specified by:
findPromptValuesForPromptDefinition in interface PromptValuesInterface
Parameters:
promptDefinition - The PromptDefinitionInterface to find the PromptValues for.
Returns:
PromptValuesInterface
See Also:
PromptValuesInterface.findPromptValuesForPromptDefinition(PromptDefinitionInterface)

acceptPromptValuesVisitor

public void acceptPromptValuesVisitor(PromptValuesVisitorInterface visitor)
Accept method for visitor object (see visitor pattern) which passes the visitor on to any delegate PromptValues objects.

Specified by:
acceptPromptValuesVisitor in interface PromptValuesInterface
Parameters:
visitor - PromptValuesVisitorInterface
See Also:
PromptValuesInterface.acceptPromptValuesVisitor(PromptValuesVisitorInterface)

getDefinitionElementName

public java.lang.String getDefinitionElementName()
Internal persistence method

Specified by:
getDefinitionElementName in interface com.sas.util.xmlpersist.PersistenceInterface
Overrides:
getDefinitionElementName in class com.sas.util.xmlpersist.impl.BaseAbstractPersistence
Returns:
the class name

consumeRelatedObjects

public void consumeRelatedObjects(com.sas.util.xmlpersist.RelatedObjectListsHolder roHolder)
                           throws org.xml.sax.SAXException
Internal persistence method

Specified by:
consumeRelatedObjects in interface com.sas.util.xmlpersist.PersistenceInterface
Overrides:
consumeRelatedObjects in class com.sas.util.xmlpersist.impl.BaseAbstractPersistence
Throws:
org.xml.sax.SAXException

consumeAttributes

public void consumeAttributes(com.sas.util.xmlpersist.AttributesProvider provider)
Internal persistence method

Specified by:
consumeAttributes in interface com.sas.util.xmlpersist.PersistenceInterface
Overrides:
consumeAttributes in class com.sas.util.xmlpersist.impl.BaseAbstractPersistence

writeDefinition

protected void writeDefinition(org.w3c.dom.Element element,
                               com.sas.util.xmlpersist.PromptsWritingContext writingContext)
                        throws java.util.prefs.BackingStoreException
Internal persistence method

Overrides:
writeDefinition in class com.sas.util.xmlpersist.impl.BaseAbstractPersistence
Throws:
java.util.prefs.BackingStoreException

getWritableValues

protected java.util.List getWritableValues()
Internal persistence method


getAllWritableValues

protected void getAllWritableValues(java.util.List allDefinitionReferences)
Internal persistence method


getWritableCombinations

protected java.util.List getWritableCombinations()
Internal persistence method




Copyright © 2009 SAS Institute Inc. All Rights Reserved.