Top Description Methods
javax.portlet

public Interface MutablePortletParameters

extends PortletParameters, Mutable
Known Direct Subinterfaces
javax.portlet.MutableRenderParameters, javax.portlet.MutableResourceParameters, javax.portlet.MutableActionParameters
Known Direct Implementers
javax.portlet.filter.MutablePortletParametersWrapper
Imports
java.util.Set

The MutablePortletParameters provides methods that allow setting parameters to define a potential future render state.

RenderState provides a description of the render state. PortletParameters provides a description of the parameter concept.

Since
3.0
See Also
RenderState, PortletParameters, MutableRenderState

Method Summary

Modifier and TypeMethod and Description
public MutablePortletParameters

Returns:

MutablePortletParameters object containing the previous values
add
(PortletParameters
- input portlet parameters
params
)

Adds the parameters from the input PortletParameters object if they are not already present.
public void
clear()

Clears all parameters.
public Set<String>

Returns:

a Set of String objects, each String containing the name of a parameter; or an empty Set if the MutablePortletParameters object has no parameters.
getNames
()

Redeclares javax.portlet.PortletParameters.getNames.

Returns a Set of String objects containing the names of the parameters contained in this object.
public boolean

Returns:

true if the parameter name was present.
removeParameter
(String
the parameter name
name
)

Removes the given public or private parameter.
public MutablePortletParameters

Returns:

MutablePortletParameters object containing the previous values
set
(PortletParameters
- input portlet parameters
params
)

Makes the public and private parameters identical to those of the input PortletParameters object.
public String

Returns:

The previous parameter value, or null if there was no previous value.
setValue
(String
the parameter name
name
,
String
the parameter value
value
)

Sets a String parameter.
public String[]

Returns:

The previous parameter value array, or null if there was no previous value.
setValues
(String
the parameter name
name
,
String...
An array of parameter values
values
)

Sets a multivalued String parameter.
Inherited from javax.portlet.PortletParameters:
clonegetValuegetValuesisEmptysize

Method Detail

addback to summary
public MutablePortletParameters add(PortletParameters params)

Adds the parameters from the input PortletParameters object if they are not already present. If a parameter from the input object is already present, its value will be updated with the input value.

The parameters are copied so that after the operation completes, there is no linkage to the input object.

Parameters
params:PortletParameters

- input portlet parameters

Returns:MutablePortletParameters

MutablePortletParameters object containing the previous values

clearback to summary
public void clear()

Clears all parameters.
getNamesback to summary
public Set<String> getNames()

Redeclares javax.portlet.PortletParameters.getNames.

Returns a Set of String objects containing the names of the parameters contained in this object.

A parameter cannot be added through use of the set. However, removing a parameter from the set will remove the underlying parameter.

Only parameter names targeted to the current portlet are returned.

Returns:Set<String>

a Set of String objects, each String containing the name of a parameter; or an empty Set if the MutablePortletParameters object has no parameters.

removeParameterback to summary
public boolean removeParameter(String name)

Removes the given public or private parameter. All values associated with the name are removed.
Parameters
name:String

the parameter name

Returns:boolean

true if the parameter name was present.

Exceptions
IllegalArgumentException:
if name is null.
setback to summary
public MutablePortletParameters set(PortletParameters params)

Makes the public and private parameters identical to those of the input PortletParameters object.

The parameters are copied so that after the operation completes, there is no linkage to the input object.

Parameters
params:PortletParameters

- input portlet parameters

Returns:MutablePortletParameters

MutablePortletParameters object containing the previous values

setValueback to summary
public String setValue(String name, String value)

Sets a String parameter.

If the parameter already exists, this method replaces all existing values with the new value.

A parameter value of null is valid.

To remove a parameter, use removeParameter(String).

Parameters
name:String

the parameter name

value:String

the parameter value

Returns:String

The previous parameter value, or null if there was no previous value.

Exceptions
IllegalArgumentException:
if name is null.
setValuesback to summary
public String[] setValues(String name, String... values)

Sets a multivalued String parameter.

If the parameter already exists, this method replaces all existing values with the new value array.

An input value of null or an empty array is valid. These values will be preserved when reading the parameter through PortletParameters#getValues(String), but will be mapped to the value null when the parameter is read through PortletParameters#getValue(String).

A parameter value of null within the array is valid.

To remove a parameter, use removeParameter(String).

Parameters
name:String

the parameter name

values:String[]

An array of parameter values

Returns:String[]

The previous parameter value array, or null if there was no previous value.

Exceptions
IllegalArgumentException:
if name is null