com.sap.portal.navigation.json.list

Class JSONListItem

java.lang.Object
  extended by com.sap.portal.navigation.json.list.JSONListItem

public class JSONListItem
extends Object

Describes the JSONListItem data object


Constructor Summary
JSONListItem(String id, String title)
          Default constructor for an item
JSONListItem(String id, String title, JSONListConstants.JSONListItemType type, String action, int showType, String iconURI, String category, Map<String,String> additionalAttributes)
          Full constructor for an item
 
Method Summary
 void addAdditionalAttribute(String key, String value)
          Adds an attribute to the additional attributes map
 String getAction()
          Returns the item action
 Map<String,String> getAdditionalAttributes()
          Returns the item's additional attributes map
 String getAttributeByKey(String key)
          Returns an attribute value by key from the additional attributes map
 String getCategory()
          Returns the item category
 String getIconURI()
          Returns the item icon URI
 String getID()
          Returns the item ID
 com.sap.portal.navigation.json.JSONObject getJSON()
          Returns a JSON object that represents an item.
 int getShowType()
          Returns the item show type, which determines where the content of an item is displayed
 String getTitle()
          Returns the item title
 JSONListConstants.JSONListItemType getType()
          Returns the item JSONListConstants.JSONListItemType
 void setAction(String action)
          Sets the item action
 void setAdditionalAttributes(Map<String,String> additionalAttributes)
          Sets the item's additional attributes map
 void setCategory(String category)
          Sets the item category
 void setIconURI(String iconURI)
          Sets the item icon URI
 void setShowType(int showType)
          Sets the item show type, which determines where the content of an item is displayed
 void setType(JSONListConstants.JSONListItemType type)
          Sets the item JSONListConstants.JSONListItemType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONListItem

public JSONListItem(String id,
                    String title)
             throws IllegalArgumentException
Default constructor for an item

Parameters:
id - Item ID
title - Item title
Throws:
IllegalArgumentException - in case the ID or title is invalid or equal to 'Null'

JSONListItem

public JSONListItem(String id,
                    String title,
                    JSONListConstants.JSONListItemType type,
                    String action,
                    int showType,
                    String iconURI,
                    String category,
                    Map<String,String> additionalAttributes)
             throws IllegalArgumentException
Full constructor for an item

Parameters:
id - Item ID
title - Item title
type - Item JSONListConstants.JSONListItemType
action - Item action
showType - Item showType - Determines where the content of an item is displayed
iconURI - Item iconURI
category - Item category
additionalAttributes - Item additional Attributes
Throws:
IllegalArgumentException - in case the ID, title or type is invalid or equal to 'Null'
Method Detail

getID

public String getID()
Returns the item ID

Returns:
Item ID

getTitle

public String getTitle()
Returns the item title

Returns:
Item title

getType

public JSONListConstants.JSONListItemType getType()
Returns the item JSONListConstants.JSONListItemType

Returns:
Item JSONListConstants.JSONListItemType

getAction

public String getAction()
Returns the item action

Returns:
Item action

getShowType

public int getShowType()
Returns the item show type, which determines where the content of an item is displayed

Returns:
Item show type

getIconURI

public String getIconURI()
Returns the item icon URI

Returns:
Item icon URI

getCategory

public String getCategory()
Returns the item category

Returns:
Item category

getAdditionalAttributes

public Map<String,String> getAdditionalAttributes()
Returns the item's additional attributes map

Returns:
Item's additional attributes map

getAttributeByKey

public String getAttributeByKey(String key)
Returns an attribute value by key from the additional attributes map

Parameters:
key - Attribute key
Returns:
Attribute value

setType

public void setType(JSONListConstants.JSONListItemType type)
             throws IllegalArgumentException
Sets the item JSONListConstants.JSONListItemType

Parameters:
type - JSONListConstants.JSONListItemType
Throws:
IllegalArgumentException - in case type is equal to 'Null'

setAction

public void setAction(String action)
Sets the item action

Parameters:
action - Item action

setShowType

public void setShowType(int showType)
Sets the item show type, which determines where the content of an item is displayed

Parameters:
showType - Item show type

setIconURI

public void setIconURI(String iconURI)
Sets the item icon URI

Parameters:
iconURI - Item icon URI

setCategory

public void setCategory(String category)
Sets the item category

Parameters:
category - Item category

setAdditionalAttributes

public void setAdditionalAttributes(Map<String,String> additionalAttributes)
Sets the item's additional attributes map

Parameters:
additionalAttributes - Item additional attributes map

addAdditionalAttribute

public void addAdditionalAttribute(String key,
                                   String value)
                            throws IllegalArgumentException
Adds an attribute to the additional attributes map

Parameters:
key - Attribute key
value - Attribute value
Throws:
IllegalArgumentException - in case the key or attribute is ‘Null’

getJSON

public com.sap.portal.navigation.json.JSONObject getJSON()
Returns a JSON object that represents an item.
Only attributes that do not equal 'Null' are added to the JSON object.

Returns:
JSONObject
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/navigation/api api EP-PIN


Copyright 2015 SAP AG Complete Copyright Notice