|
SAP NetWeaver 7.31 Enterprise Portal (SP 16) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sap.portal.navigation.json.list.JSONList
public class JSONList
Represents a list of items to be used in a JSON list.
The list contains a LinkedHashMap that maintains paired values of categories and list items.
Each category contains a LinkedList of items to maintain the insertion order.
When adding an item to the list, if the item's category attribute is valid (not empty and not null),
a corresponding category is added to the LinkedHashMap and the item is added to the category's LinkedList.
If the category already exists, the item is added to the category's LinkedList.
If the item does not have a category, it is added to the default category, defined by the JSONListConstants.DEFAULT_CATEGORY key.
The default category is always first when consuming the list.
| Constructor Summary | |
|---|---|
JSONList()
Default constructor |
|
| Method Summary | |
|---|---|
void |
addItem(JSONListItem item)
Adds an item to the list |
void |
removeItem(JSONListItem item)
Remove an JSONListItem from the list |
String |
toJSON()
This method iterates through the items in the list and returns the toString() representation of a JSON array that contains all of the list items |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JSONList()
| Method Detail |
|---|
public void addItem(JSONListItem item)
throws IllegalArgumentException
item - JSONListItem to add
IllegalArgumentException - in case item is null
public void removeItem(JSONListItem item)
throws IllegalArgumentException
JSONListItem from the list
item - JSONListItem to be removed
IllegalArgumentException - in case item is null or item does not exist in the listpublic String toJSON()
toString() representation of a JSON array that contains all of the list items
toString() representation of a JSON array that contains all of the list items| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] EP-RUNTIME
|
[sap.com] tc/ep/navigation/api
|
api
|
EP-PIN
|
|
SAP NetWeaver 7.31 Enterprise Portal (SP 16) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||