java.lang.Object | |
↳ | com.microstrategy.web.beans.GenericRequestKeys |
![]() |
![]() |
This class provides provides a skeletal implementation of the interface
RequestKeys
, to minimize the effort required to implement this
interface and allow subclasses to focus only on how to initialize the
key-values collection from various sources.
The implementation of this class actually adopts lazy initialization.
It calls back the protected method initializeRequestKeys()
when the
first time you access to the key-values collection. Subclasses should
provide their own specific implementation of initialization.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GenericRequestKeys()
Constructs a new GenericRequestKeys instance
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String |
add(String key, String value)
Appends a value to a collection mapped by the key specified.
| ||||||||||
Object |
addObject(String key, Object value)
Appends an Object to a collection mapped by the key specified.
| ||||||||||
MarkupOutput |
getDebugOut()
Get the Debug Information into the output
| ||||||||||
int |
getIntValue(String keyName, int valueIndex, int defaultValue)
Parses the value of given request key to an integer.
| ||||||||||
int |
getIntValue(String keyName, int valueIndex)
Parses the value of given request key to an integer.
| ||||||||||
Enumeration |
getKeyListByPrefix(String prefix)
Returns an enumeration over all the keys with the specified prefix.
| ||||||||||
String |
getName(int nameIndex)
Returns the key at the specified position from the current collection.
| ||||||||||
int |
getNameCount()
Returns the total number of keys stored in the collection.
| ||||||||||
String |
getValue(String keyName)
Returns from this collection a comma separated string of all the
values mapped by the specified
keyName . | ||||||||||
String |
getValue(String keyName, int valueIndex)
Returns the value at the specified position mapped by the specified
keyName.
| ||||||||||
int |
getValueCount(String keyName)
Returns from this collection the number of values mapped with the
keyName.
| ||||||||||
Object |
getValueObject(String keyName, int valueIndex)
Returns the Object at the specified position mapped by the specified
keyName.
| ||||||||||
Enumeration |
getValueObject(String key)
Returns the collection of all the values mapped by the specified
keyName . | ||||||||||
boolean |
isEmpty()
Returns whether the value collection is empty.
| ||||||||||
void |
remove(String key)
Removes the argument with the given key.
| ||||||||||
void |
setValue(String key, String value, int index)
Replaces the value at a specific index for a given key.
| ||||||||||
void |
setValueObject(String key, Object value, int index)
Replaces the Object at a specific index for a given key.
| ||||||||||
String | toString() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String |
add(String key, String value, String delimiter)
Appends a value to a collection mapped by the key specified.
| ||||||||||
LinkedList |
addKeyValue(String key, Object value)
Adds an Object to the collection defined by the key.
| ||||||||||
LinkedList |
getAllValues(String keyName)
Retrieves all values associated with the key.
| ||||||||||
Object |
getObjectAtIndex(String keyName, int valueIndex)
Retrieves the Object located at a specific index within the collection
defined by keyName.
| ||||||||||
void |
initializeRequestKeys()
Initializes the key-value collection from various sources.
| ||||||||||
void |
setInitialized(boolean initialized)
Sets a flag indicating whether this collection has been initialized.
| ||||||||||
void |
setObjectAtIndex(String key, Object value, int index)
Used by setValue and setValueObject to do the actual work.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructs a new GenericRequestKeys instance
Appends a value to a collection mapped by the key specified.
A new collection is created if there is no such an collection existing.
The initialized
flag is set to True
after
calling this method.
By default, there is no tokenizing of the string.
This call is equivalent to call add(key, value, null)
.
key | the key under which the new value will be appended |
---|---|
value | the value to be appended |
Appends an Object to a collection mapped by the key specified.
A new collection is created if there is no such an collection existing.
The initialized
flag is set to True
after
calling this method.
key | the key under which the new Object will be appended |
---|---|
value | the Object to be appended |
Get the Debug Information into the output
MarkupOutput
.Parses the value of given request key to an integer.
defaultValue | The default value. |
---|
Parses the value of given request key to an integer.
keyName | The request key name |
---|---|
valueIndex | an index of the value to return (must be between 0
and getValueCount(name)-1 . |
Returns an enumeration over all the keys with the specified prefix.
Returns all the keys if the specified prefix is null or empty.
Returns an empty list if no key is found.
prefix | the prefix of keys. |
---|
Returns the key at the specified position from the current collection.
nameIndex | the index of the key |
---|
Returns the total number of keys stored in the collection.
Returns from this collection a comma separated string of all the
values mapped by the specified keyName
.
keyName | a key in this collection |
---|
Returns the value at the specified position mapped by the specified keyName.
keyName | a key in this collection |
---|---|
valueIndex | the index of a value mapped to the key specified |
Returns from this collection the number of values mapped with the keyName.
keyName | a key to a value collection |
---|
Returns the Object at the specified position mapped by the specified keyName.
keyName | a key in this collection |
---|---|
valueIndex | the index of an Object mapped to the key specified |
Returns the collection of all the values mapped by the specified keyName
.
key | a key in this collection |
---|
Returns whether the value collection is empty.
Removes the argument with the given key.
key | the key of the argument to remove. |
---|
Replaces the value at a specific index for a given key. As any
key may have several values, this method replaces a specific value.
Nothing happens if the index
is out of bounds.
key | the new key whose correponding value is to be added |
---|---|
value | the new value to be added |
index | the position to add the key-value pair. |
Replaces the Object at a specific index for a given key. As any
key may have several Objects, this method replaces a specific Object.
Nothing happens if the index
is out of bounds.
key | the new key whose correponding Object is to be added |
---|---|
value | the new Object to be added |
index | the position to add the key-value pair. |
Appends a value to a collection mapped by the key specified.
A new collection is created if there is no such an collection existing.
The initialized
flag is set to True
after
calling this method.
This method uses the specified delimiter
to tokenize
the value before adding each token into the collection.
key | the key under which the new value will be appended. |
---|---|
value | the value to be appended. |
delimiter | the String delimiter used in tokenization. |
Adds an Object to the collection defined by the key. Creates the collection if it doesn't exist yet.
key | the key under which the new Object will be appended |
---|---|
value | the Object to be appended |
Retrieves all values associated with the key. Decoded values are added if they exist.
keyName | the key to retrieve all values for |
---|
Retrieves the Object located at a specific index within the collection defined by keyName.
keyName | key of object collection |
---|---|
valueIndex | position of Object to retrieve |
Initializes the key-value collection from various sources.
Implementation class extending this class needs to call the
add(String, String)
method to add key-value pairs into the collection.
Sets a flag indicating whether this collection has been initialized.
A false value will trigger this object to re-intialize itself by calling
the method initializeRequestKeys()
.
initialized | true if the current collection has been initialized. |
---|
Used by setValue and setValueObject to do the actual work.
key | the new key whose correponding Object is to be added |
---|---|
value | the new Object to be added |
index | the position to add the key-value pair. |