com.sapportals.wcm.repository.service.layout.customizing

Interface IParameters

All Known Subinterfaces:
IParameterMap
All Known Implementing Classes:
AbstractCollectionRenderer, LayoutObject, LightCollectionRenderer

public interface IParameters

The Parameters is a set of parameters used within the com.sapportals.rendering package. It provides a Properties like access to values with a default mechanism. A default Parameters object can be provided which is used, when a value is not found in the current object and in the getParameter methods a default value can be provided. Null key's or values are not permitted. All values are stored as String and can be retrieved as int or boolean as well. A special paramter with the key IParameterName.PARAMETERSET can be used to include other paramters sets within this paramter set. All included paramters sets are used to search for a key, if this key is not found in the main set.


Method Summary
 Object get(String key)
          Returns the value to which the specified key is mapped in this parameters set or in the default or in the default parameter set, when not found.
 List getMultiValueParameter(IParameterName key)
          Searches for the parameter with the specified key.
 String getParameter(IParameterName key)
          Searches for the parameter with the specified key.
 boolean getParameter(IParameterName key, boolean defaultValue)
          Searches for the parameter with the specified key.
 int getParameter(IParameterName key, int defaultValue)
          Searches for the parameter with the specified key.
 String getParameter(IParameterName key, String defaultValue)
          Searches for the parameter with the specified key.
 TextViewDesign getParameter(IParameterName key, TextViewDesign defaultValue)
          Searches for the parameter with the specified key.
 IParameters getParameters(IParameterName[] keys)
           
 boolean isExactlyValue(IParameterName key, Object checkValue)
          Checks if an entry in the set exists for the specified key, which has the specified value.
 boolean isNoOtherValue(IParameterName key, Object checkValue)
          Checks for a key if no other value than the specified value is set.
 IParameterNameSet parameterNames()
          Returns an enumeration of all the keys in this parameter set, including the keys in the default parameter set and all included paramters.
 Set parameters()
          Returns a Set view of the parameters contained in this parameters set.
 void removeParameter(IParameterName key)
          removes the parameter specified from the paramters map.
 Boolean setParameter(IParameterName key, boolean value)
          Calls the map.put(key, value) method.
 Integer setParameter(IParameterName key, int value)
          Calls the map.put(key, value) method.
 Object setParameter(IParameterName key, Object value)
           
 String setParameter(IParameterName key, String value)
          Calls the map.put(key, value) method.
 TextViewDesign setParameter(IParameterName key, TextViewDesign value)
          Calls the map.put(key, value) method.
 

Method Detail

setParameter

public Object setParameter(IParameterName key,
                           Object value)

setParameter

public String setParameter(IParameterName key,
                           String value)
Calls the map.put(key, value) method. This method is parrallel to the String getParameter(IParameterName key) method.

Parameters:
key - The key for the new Parameter
value - The value for the new Parameter
Returns:
previous value associated with specified key, or null if there was no mapping for key.
Throws:
NullpointerException - if the key or the value is null

setParameter

public Integer setParameter(IParameterName key,
                            int value)
Calls the map.put(key, value) method. This method is parrallel to the String getParameter(IParameterName key) method. Here an int can be provided. The value will be stored as String .

Parameters:
key - The key for the new Parameter
value - The value for the new Parameter
Returns:
previous value associated with specified key, or null if there was no mapping for key.
Throws:
NullpointerException - if the key or the value is null
ClassCastException - if the old value is not a String
NumberFormatException - - if the old value cannot be parsed as an int.

setParameter

public TextViewDesign setParameter(IParameterName key,
                                   TextViewDesign value)
Calls the map.put(key, value) method. This method is parrallel to the String getParameter(IParameterName key) method. Here an TextViewDesign can be provided. The value will be stored as String .

Parameters:
key - The key for the new Parameter
value - The value for the new Parameter
Returns:
previous value associated with specified key, or null if there was no mapping for key.
Throws:
NullpointerException - if the key or the value is null
ClassCastException - if the old value is not a String

setParameter

public Boolean setParameter(IParameterName key,
                            boolean value)
Calls the map.put(key, value) method. This method is parrallel to the String getParameter(IParameterName key) method. Here an int can be provided. The value will be stored as String .

Parameters:
key - The key for the new Parameter
value - The value for the new Parameter
Returns:
previous value associated with specified key, or null if there was no mapping for key.
Throws:
NullpointerException - if the key or the value is null
ClassCastException - if the old value is not a String

removeParameter

public void removeParameter(IParameterName key)
removes the parameter specified from the paramters map. Only the first level map is considered. The paramter is not removed from any default map.


get

public Object get(String key)
Returns the value to which the specified key is mapped in this parameters set or in the default or in the default parameter set, when not found.

Parameters:
key - a key of the parameter.
Returns:
the value to which the key is mapped in this parameters set; null if the key is not mapped to any value in this parameters set or in the default.
See Also:
#put(Object, Object)

parameterNames

public IParameterNameSet parameterNames()
Returns an enumeration of all the keys in this parameter set, including the keys in the default parameter set and all included paramters.

Returns:
an enumeration of all the keys in this parameter set, including the keys in the default parameter set.
See Also:
Enumeration

parameters

public Set parameters()
Returns a Set view of the parameters contained in this parameters set. Each element in this collection is a Map.Entry. In contrast to method entrySet() this set is not backed up by the map, but it contains all paramters accessible via this Paramters map, this means, all paramters contained in the map, in the default map and in all included parameter sets.

Returns:
a set view of the mappings contained in this parameters set.

getParameters

public IParameters getParameters(IParameterName[] keys)

getParameter

public String getParameter(IParameterName key)
Searches for the parameter with the specified key. If the key is not found in this parameter set, the default parameter set, and its defaults, recursively, are then checked. The method returns null if the parameter is not found.

Parameters:
key - the parameters key.
Returns:
the value in this parameter set with the specified key value.

getMultiValueParameter

public List getMultiValueParameter(IParameterName key)
Searches for the parameter with the specified key. If the key is not found in this parameter set, the default parameter set, and its defaults, recursively, are then checked. The method returns null if the parameter is not found. The parameter is returned as java.util.List , even if it is a single Value Parameter. The class of the returned objects in the list can be asked via key.getMetaDate().getParameterClass()

Parameters:
key - the parameters key.
Returns:
the value in this parameter set with the specified key value.

getParameter

public String getParameter(IParameterName key,
                           String defaultValue)
Searches for the parameter with the specified key. If the key is not found in this parameter set, the default parameter set, and its defaults, recursively, are then checked. The method returns the default value argument if the parameter is not found.

Parameters:
key - the parameters key.
defaultValue -
Returns:
the value in this parameter set with the specified key value.

getParameter

public int getParameter(IParameterName key,
                        int defaultValue)
Searches for the parameter with the specified key. If the key is not found in this parameter set, the default parameter set, and its defaults, recursively, are then checked. The method returns the default value argument if the parameter is not found. The value is returned as int if possible.

Parameters:
key - the parameters key.
defaultValue - a default value.
Returns:
the value in this parameter set with the specified key value.

getParameter

public boolean getParameter(IParameterName key,
                            boolean defaultValue)
Searches for the parameter with the specified key. If the key is not found in this parameter set, the default parameter set, and its defaults, recursively, are then checked. The method returns the default value argument if the parameter is not found. The value is returned as boolean . The boolean returned represents the value true if the parameters value is equal, ignoring case, to the string "true" .

Example: Boolean.valueOf("True") returns true .
Example: Boolean.valueOf("yes") returns false .

Parameters:
key - the parameters key.
defaultValue - a default value.
Returns:
the value in this parameter set with the specified key value.

getParameter

public TextViewDesign getParameter(IParameterName key,
                                   TextViewDesign defaultValue)
Searches for the parameter with the specified key. If the key is not found in this parameter set, the default parameter set, and its defaults, recursively, are then checked. The method returns the default value argument if the parameter is not found. The value is returned as TextViewDesign . If the stored String can not be converted into a TextViewDesign null is returned.

Parameters:
key - the parameters key.
defaultValue - a default value.
Returns:
the value in this parameter set with the specified key value.

isNoOtherValue

public boolean isNoOtherValue(IParameterName key,
                              Object checkValue)
Checks for a key if no other value than the specified value is set. The value for the specified key is searched via the Object get(Object key) method an true is returned when no value is not found or the found value equals the specified value.

Parameters:
key - the paramters key to search
checkValue - the value to compare with
Returns:
true, if no entry is found for the specified key or if the found value equals the specified value
See Also:
get(Object key)

isExactlyValue

public boolean isExactlyValue(IParameterName key,
                              Object checkValue)
Checks if an entry in the set exists for the specified key, which has the specified value. The value for the specified key is searched via the Object get(Object key) method an true is returned when a value is found which equals the specified value.

Parameters:
key - the paramters key to search
checkValue - the value to compare with
Returns:
true, if a value is found which equals the specified value
See Also:
get(Object key)


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.