|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.template.soy.data.SoyData
com.google.template.soy.data.restricted.CollectionData
public abstract class CollectionData
Abstract superclass for a node in a Soy data tree that represents a collection of data (i.e. an internal node).
Important: This class may only be used in implementing plugins (e.g. functions, directives).
| Constructor Summary | |
|---|---|
CollectionData()
|
|
| Method Summary | |
|---|---|
protected static SoyData |
ensureValidValue(SoyData value)
Ensures that the given value is valid for insertion into a Soy data tree. |
SoyData |
get(String keyStr)
Gets the data at the specified key string. |
boolean |
getBoolean(String keyStr)
Precondition: The specified key string is the path to a boolean. |
double |
getFloat(String keyStr)
Precondition: The specified key string is the path to a float. |
int |
getInteger(String keyStr)
Precondition: The specified key string is the path to an integer. |
SoyListData |
getListData(String keyStr)
Precondition: The specified key string is the path to a SoyListData object. |
SoyMapData |
getMapData(String keyStr)
Precondition: The specified key string is the path to a SoyMapData object. |
abstract SoyData |
getSingle(String key)
Important: Do not use outside of Soy code (treat as superpackage-private). |
String |
getString(String keyStr)
Precondition: The specified key string is the path to a string. |
void |
put(Object... data)
Convenience function to put multiple mappings in one call. |
void |
put(String keyStr,
boolean value)
Puts data into this data tree at the specified key string. |
void |
put(String keyStr,
double value)
Puts data into this data tree at the specified key string. |
void |
put(String keyStr,
int value)
Puts data into this data tree at the specified key string. |
void |
put(String keyStr,
SoyData value)
Puts data into this data tree at the specified key string. |
void |
put(String keyStr,
String value)
Puts data into this data tree at the specified key string. |
abstract void |
putSingle(String key,
SoyData value)
Important: Do not use outside of Soy code (treat as superpackage-private). |
void |
remove(String keyStr)
Removes the data at the specified key string. |
abstract void |
removeSingle(String key)
Important: Do not use outside of Soy code (treat as superpackage-private). |
| Methods inherited from class com.google.template.soy.data.SoyData |
|---|
booleanValue, createFromExistingData, createFromExistingData, equals, floatValue, integerValue, numberValue, stringValue, toBoolean, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CollectionData()
| Method Detail |
|---|
public void put(Object... data)
data - The mappings to put, as alternating keys/values. Indices 0, 2, 4, ... must be valid
key strings. Indices 1, 3, 5, ... must be valid Soy data values.
SoyDataException - When attempting to add an invalid varargs list or a mapping containing
an invalid key.
public void put(String keyStr,
SoyData value)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.value - The data to put at the specified location.
public void put(String keyStr,
boolean value)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.value - The data to put at the specified location.
public void put(String keyStr,
int value)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.value - The data to put at the specified location.
public void put(String keyStr,
double value)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.value - The data to put at the specified location.
public void put(String keyStr,
String value)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.value - The data to put at the specified location.public void remove(String keyStr)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.public SoyData get(String keyStr)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.
public SoyMapData getMapData(String keyStr)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.
public SoyListData getListData(String keyStr)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.
public boolean getBoolean(String keyStr)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.
IllegalArgumentException - If no data is stored at the specified key.public int getInteger(String keyStr)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.
IllegalArgumentException - If no data is stored at the specified key.public double getFloat(String keyStr)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.
IllegalArgumentException - If no data is stored at the specified key.public String getString(String keyStr)
keyStr - One or more map keys and/or list indices (separated by '.' if multiple parts).
Indicates the path to the location within this data tree.
IllegalArgumentException - If no data is stored at the specified key.
public abstract void putSingle(String key,
SoyData value)
key - An individual key.value - The data to put at the specified key.public abstract void removeSingle(String key)
key - An individual key.public abstract SoyData getSingle(String key)
key - An individual key.
protected static SoyData ensureValidValue(SoyData value)
value - The value to ensure validity for.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||