站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

Parameters - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.portlet
Class Parameters

java.lang.Object
  extended byorg.jboss.portal.common.util.TypedMap
      extended byorg.jboss.portal.common.util.ParameterMap
          extended byorg.jboss.portal.portlet.Parameters
All Implemented Interfaces:
java.util.Map, java.io.Serializable

public final class Parameters
extends ParameterMap
implements java.io.Serializable

A set of parameters.

Version:
$Revision: 5448 $
Author:
Julien Viet
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.jboss.portal.common.util.TypedMap
TypedMap.TypedEntry, TypedMap.TypedEntryIterator, TypedMap.TypedEntrySet
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private  java.util.Map map
          The data.
private static long serialVersionUID
          The serialVersionUID
 
Constructor Summary
Parameters()
          Creates an empty parameter set.
Parameters(java.util.Map parameterMap)
          Copy the parameter map to initialize the object state.
Parameters(Parameters parameters)
          Copy constructor.
 
Method Summary
 void append(java.util.Map params)
          Append the content of the argument map to that map.
protected  void checkValidity(java.util.Map that)
           
 boolean equals(java.lang.Object o)
          Compare to parameters objects.
protected  java.util.Map getDelegate()
           
 java.lang.String getValue(java.lang.String name)
          Return the parameter value or null if it does not exist.
 java.lang.String[] getValues(java.lang.String name)
          Return the parameter values or null if it does not exist.
private  void internalAppend(java.util.Map params)
          Append actual implementation.
 void replace(java.util.Map params)
          Replace all the existing parameters with the new ones.
 void setValue(java.lang.String name, java.lang.String value)
          Set the a parameter value.
 void setValues(java.lang.String name, java.lang.String[] values)
          Set the parameter values.
 java.lang.String toString()
           
 
Methods inherited from class org.jboss.portal.common.util.ParameterMap
assertKeyValidity, getExternalValue, getInternalValue
 
Methods inherited from class org.jboss.portal.common.util.TypedMap
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
hashCode
 

Field Detail

serialVersionUID

private static final long serialVersionUID
The serialVersionUID

See Also:
Constant Field Values

map

private java.util.Map map
The data.

Constructor Detail

Parameters

public Parameters()
Creates an empty parameter set.


Parameters

public Parameters(Parameters parameters)
           throws java.lang.IllegalArgumentException
Copy constructor.

Throws:
java.lang.IllegalArgumentException - if the parameters is null

Parameters

public Parameters(java.util.Map parameterMap)
           throws java.lang.NullPointerException,
                  java.lang.ClassCastException,
                  java.lang.IllegalArgumentException
Copy the parameter map to initialize the object state.

Throws:
java.lang.IllegalArgumentException - if the parameter map is null or not valid
java.lang.NullPointerException - if the map contains a null key or a null value
java.lang.IllegalArgumentException - if the map is null or it contains a value with a zero length array or a null element in the array
java.lang.ClassCastException - if the map contains a key that is not a string or a value that is not a string array
Method Detail

getDelegate

protected java.util.Map getDelegate()
Specified by:
getDelegate in class TypedMap

getValue

public java.lang.String getValue(java.lang.String name)
                          throws java.lang.IllegalArgumentException
Return the parameter value or null if it does not exist.

Parameters:
name - the parameter name
Returns:
the parameter value or null if it does not exist
Throws:
java.lang.NullPointerException - if the name is null
java.lang.IllegalArgumentException

getValues

public java.lang.String[] getValues(java.lang.String name)
                             throws java.lang.IllegalArgumentException
Return the parameter values or null if it does not exist.

Parameters:
name - the value to get
Returns:
the parameter values
Throws:
java.lang.NullPointerException - if the name is null
java.lang.IllegalArgumentException

setValue

public void setValue(java.lang.String name,
                     java.lang.String value)
Set the a parameter value.

Parameters:
name - the parameter name
value - the parameter value
Throws:
java.lang.NullPointerException - if the name or the value is null

setValues

public void setValues(java.lang.String name,
                      java.lang.String[] values)
               throws java.lang.NullPointerException,
                      java.lang.IllegalArgumentException
Set the parameter values. This method does not make a defensive copy of the values.

Parameters:
name - the parameter name
values - the parameter values
Throws:
java.lang.NullPointerException - if the name or the value is null
java.lang.IllegalArgumentException - if the values length is zero or contains a null element

append

public void append(java.util.Map params)
            throws java.lang.ClassCastException,
                   java.lang.NullPointerException,
                   java.lang.IllegalArgumentException
Append the content of the argument map to that map. If both maps contains an entry sharing the same key, then the string arrays or the two entries will be concatenated into a single array. Each entry present on the argument map and not in the current map will be kept as is. The argument validation is performed before the state is updated.

Parameters:
params - the parameters to appends
Throws:
java.lang.NullPointerException - if the map contains a null key or a null value
java.lang.IllegalArgumentException - if the map is null or it contains a value with a zero length array or a null element in the array
java.lang.ClassCastException - if the map contains a key that is not a string or a value that is not a string array

replace

public void replace(java.util.Map params)
Replace all the existing parameters with the new ones. The argument validation is performed before the state is updated.

Parameters:
params - the parameters to replace
Throws:
java.lang.NullPointerException - if the map contains a null key or a null value
java.lang.IllegalArgumentException - if the map is null or it contains a value with a zero length array or a null element in the array
java.lang.ClassCastException - if the map contains a key that is not a string or a value that is not a string array

internalAppend

private void internalAppend(java.util.Map params)
Append actual implementation.


equals

public boolean equals(java.lang.Object o)
Compare to parameters objects.

Specified by:
equals in interface java.util.Map

toString

public java.lang.String toString()

checkValidity

protected void checkValidity(java.util.Map that)
                      throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException