本文整理汇总了Java中com.google.gwt.json.client.JSONBoolean.booleanValue方法的典型用法代码示例。如果您正苦于以下问题:Java JSONBoolean.booleanValue方法的具体用法?Java JSONBoolean.booleanValue怎么用?Java JSONBoolean.booleanValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.json.client.JSONBoolean
的用法示例。
在下文中一共展示了JSONBoolean.booleanValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import com.google.gwt.json.client.JSONBoolean; //导入方法依赖的package包/类
@Override
public CallResponse deserialize(String payload) throws InvalidPayload {
JSONArray array = JSONParser.parseStrict(payload).isArray();
if (array.size() != CallResponse.Message.SIZE) {
throw new InvalidPayload();
}
JSONString token = array.get(
CallResponse.Message.POSITION_TOKEN).isString();
JSONBoolean success = array.get(
CallResponse.Message.POSITION_SUCCESS).isBoolean();
JSONString returnValue = array.get(
CallResponse.Message.POSITION_RETURN_VALUE).isString();
return new CallResponse(
token.stringValue(),
success.booleanValue(),
returnValue.stringValue());
}
示例2: getHide
import com.google.gwt.json.client.JSONBoolean; //导入方法依赖的package包/类
/**
* Get the hidden status of an extra column from the JSON definition
* @param extraColumnProperties the JSON properties of the column
* @param columnIndex the index of the column
* @return the value of the hide property
*/
public static boolean getHide(JSONObject extraColumnProperties, int columnIndex) {
JSONBoolean hidden = extraColumnProperties.get("hide").isBoolean();
if (hidden != null)
return hidden.booleanValue();
else {
LOGGER.log(Level.SEVERE, "Could not read the field \"hide\" of column number " + columnIndex);
return false;
}
}
示例3: getJsonBooleanNullable
import com.google.gwt.json.client.JSONBoolean; //导入方法依赖的package包/类
private boolean getJsonBooleanNullable(JSONObject jsonObject, String attributeName, boolean defaultValue) {
JSONBoolean result = jsonObject.get(attributeName).isBoolean();
if (result == null) {
return defaultValue;
}
return result.booleanValue();
}
示例4: getBooleanValueFor
import com.google.gwt.json.client.JSONBoolean; //导入方法依赖的package包/类
public Boolean getBooleanValueFor(EditorProperties property) {
JSONValue jsonValue = getJsonValueFor(property);
if (jsonValue == null) {
return null;
}
JSONBoolean jsonBoolean = jsonValue.isBoolean();
if (jsonBoolean == null) {
return null;
}
return jsonBoolean.booleanValue();
}
示例5: getBooleanPropFromGroupJson
import com.google.gwt.json.client.JSONBoolean; //导入方法依赖的package包/类
@Override
public Boolean getBooleanPropFromGroupJson(String key, String json) {
if (json == null)
return null;
JSONObject obj = JSONParser.parseStrict(json).isObject();
if (obj != null && obj.get(key) != null) {
JSONBoolean value = obj.get(key).isBoolean();
if (value != null) {
return value.booleanValue();
}
}
return null;
}
示例6: getJsonBooleanValue
import com.google.gwt.json.client.JSONBoolean; //导入方法依赖的package包/类
/**
* Helper function to extract a boolean value from given JSON object.
*
* @param json JSON object to extract the value from.
* @param key key of the value to extract.
* @return the Boolean object extracted from JSON (can be null if the value
* does not exist or is invalid.
*/
private static Boolean getJsonBooleanValue(JSONObject json, String key) {
JSONValue value = json.get(key);
JSONBoolean bool = (value == null) ? null : value.isBoolean();
if (bool != null) {
return bool.booleanValue();
} else {
return null;
}
}
示例7: getObject
import com.google.gwt.json.client.JSONBoolean; //导入方法依赖的package包/类
@Override
public Object getObject(String key)
{
JSONValue value = m_object.get(key);
if( value != null )
{
JSONBoolean bool = value.isBoolean();
if( bool != null )
{
return (Boolean) bool.booleanValue();
}
else
{
JSONNumber number = value.isNumber();
if( number != null )
{
return number.doubleValue();
}
else
{
JSONString string = value.isString();
if( string != null )
{
return string.stringValue();
}
}
}
}
return null;
}
示例8: getJsonBooleanValue
import com.google.gwt.json.client.JSONBoolean; //导入方法依赖的package包/类
/**
* Helper function to extract a boolean value from given JSON object.
*
* @param json JSON object to extract the value from.
* @param key key of the value to extract.
* @return the Boolean object extracted from JSON (can be null if the value
* does not exist or is invalid.
*/
private static Boolean getJsonBooleanValue(JSONObject json, String key) {
JSONValue value = json.get(key);
JSONBoolean bool = value == null ? null : value.isBoolean();
return bool != null ? bool.booleanValue() : null;
}