| Constructor and Description |
|---|
JSONToken()
Creates a new empty instance of a token.
|
JSONToken(org.json.JSONObject aJSON) |
JSONToken(String aType) |
JSONToken(String aNS,
String aType) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
resets all fields of the token.
|
Object |
get(String aKey) |
Boolean |
getBoolean(String aArg) |
Boolean |
getBoolean(String aKey,
Boolean aDefault) |
Double |
getDouble(String aKey) |
Double |
getDouble(String aKey,
Double aDefault) |
Integer |
getInteger(String aKey) |
Integer |
getInteger(String aKey,
Integer aDefault) |
org.json.JSONObject |
getJSONObject() |
Iterator<String> |
getKeyIterator() |
List |
getList(String aKey) |
List |
getList(String aKey,
List aDefault) |
Long |
getLong(String aKey) |
Long |
getLong(String aKey,
Long aDefault) |
Map |
getMap() |
Map |
getMap(String aKey) |
Map |
getMap(String aKey,
Map aDefault) |
Object |
getObject(String aKey) |
String |
getString(String aKey) |
String |
getString(String aKey,
String aDefault) |
Token |
getToken(String aKey) |
Token |
getToken(String aKey,
Token aDefault) |
void |
put(String aKey,
Object aValue)
puts a new key/value pair into the token, in other words it adds a
new item to the token.
|
void |
remove(String aKey) |
void |
set(ITokenizable aTokenizable)
copies all fields of the given ITokenizable to the token.
|
void |
setBoolean(String aKey,
Boolean aValue) |
void |
setDouble(String aKey,
Double aValue) |
void |
setInteger(String aKey,
Integer aValue) |
void |
setJSONObject(org.json.JSONObject aJSON) |
void |
setList(String aKey,
List aList) |
void |
setLong(String aKey,
Long aValue) |
void |
setMap(Map aMap)
copies all fields from a Map into the Token.
|
void |
setMap(String aKey,
Map aMap) |
void |
setString(String aKey,
String aValue) |
void |
setToken(String aKey,
ITokenizable aTokenizable) |
void |
setToken(String aKey,
Token aToken) |
String |
toString() |
getNS, getType, setDouble, setNS, setType, setValidatedpublic JSONToken()
public JSONToken(String aType)
aType - public JSONToken(org.json.JSONObject aJSON)
aJSON - public void clear()
Tokenpublic void set(ITokenizable aTokenizable)
Tokenpublic void setMap(Map aMap)
Tokenpublic void setJSONObject(org.json.JSONObject aJSON)
aJSON - public org.json.JSONObject getJSONObject()
public void put(String aKey, Object aValue)
aKey - key of the the token item.aValue - value of the token item.public Integer getInteger(String aKey, Integer aDefault)
getInteger in interface TokenaKey - aDefault - public Integer getInteger(String aKey)
getInteger in interface TokenaKey - public void setInteger(String aKey, Integer aValue)
setInteger in interface Tokenpublic Boolean getBoolean(String aKey, Boolean aDefault)
getBoolean in interface TokenaKey - aDefault - public Boolean getBoolean(String aArg)
getBoolean in interface TokenaArg - public void setBoolean(String aKey, Boolean aValue)
setBoolean in interface TokenaKey - public void setToken(String aKey, ITokenizable aTokenizable)
public Iterator<String> getKeyIterator()
getKeyIterator in interface TokenCopyright © 2013. All Rights Reserved.