本文整理了Java中com.liferay.portal.kernel.json.JSONObject.getInt()
方法的一些代码示例,展示了JSONObject.getInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.getInt()
方法的具体详情如下:
包路径:com.liferay.portal.kernel.json.JSONObject
类名称:JSONObject
方法名:getInt
暂无
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public byte[] cropImage(String cropRegion)
throws IOException, PortalException {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(cropRegion);
int height = jsonObject.getInt("height");
int width = jsonObject.getInt("width");
int x = jsonObject.getInt("x");
int y = jsonObject.getInt("y");
if ((x > 0) || (y > 0) || (width > 0) || (height > 0)) {
ImageBag imageBag = ImageToolUtil.read(_bytes);
RenderedImage renderedImage = imageBag.getRenderedImage();
renderedImage = ImageToolUtil.crop(
renderedImage, height, width, x, y);
return ImageToolUtil.getBytes(renderedImage, imageBag.getType());
}
return _bytes;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
protected String getTitle(
JSONObject jsonObject, AssetRenderer<?> assetRenderer,
ServiceContext serviceContext) {
String message = StringPool.BLANK;
AssetRendererFactory<?> assetRendererFactory =
AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(
assetRenderer.getClassName());
String typeName = assetRendererFactory.getTypeName(
serviceContext.getLocale());
int notificationType = jsonObject.getInt("notificationType");
if (notificationType ==
UserNotificationDefinition.NOTIFICATION_TYPE_ADD_ENTRY) {
message = "x-added-a-new-x";
}
else if (notificationType ==
UserNotificationDefinition.NOTIFICATION_TYPE_UPDATE_ENTRY) {
message = "x-updated-a-x";
}
return getFormattedMessage(
jsonObject, serviceContext, message, typeName);
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public AuditMessage(String message) throws JSONException {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(message);
_additionalInfoJSONObject = jsonObject.getJSONObject(_ADDITIONAL_INFO);
_className = jsonObject.getString(_CLASS_NAME);
_classPK = jsonObject.getString(_CLASS_PK);
if (jsonObject.has(_CLIENT_HOST)) {
_clientHost = jsonObject.getString(_CLIENT_HOST);
}
if (jsonObject.has(_CLIENT_IP)) {
_clientIP = jsonObject.getString(_CLIENT_IP);
}
_companyId = jsonObject.getLong(_COMPANY_ID);
_eventType = jsonObject.getString(_EVENT_TYPE);
_message = jsonObject.getString(_MESSAGE);
if (jsonObject.has(_SERVER_NAME)) {
_serverName = jsonObject.getString(_SERVER_NAME);
}
if (jsonObject.has(_SERVER_PORT)) {
_serverPort = jsonObject.getInt(_SERVER_PORT);
}
if (jsonObject.has(_SESSION_ID)) {
_sessionID = jsonObject.getString(_SESSION_ID);
}
_timestamp = GetterUtil.getDate(
jsonObject.getString(_TIMESTAMP), _getDateFormat());
_userId = jsonObject.getLong(_USER_ID);
_userName = jsonObject.getString(_USER_NAME);
}
代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.io
protected DDMFormLayoutColumn getDDMFormLayoutColumn(
JSONObject jsonObject) {
DDMFormLayoutColumn ddmFormLayoutColumn = new DDMFormLayoutColumn(
jsonObject.getInt("size"));
setDDMFormLayouColumnFieldNames(
jsonObject.getJSONArray("fieldNames"), ddmFormLayoutColumn);
return ddmFormLayoutColumn;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
serviceContext.setWorkflowAction(jsonObject.getInt("workflowAction"));
代码示例来源:origin: com.liferay/com.liferay.exportimport.service
exportImportConfiguration.getType());
int status = jsonObject.getInt("status");
内容来源于网络,如有侵权,请联系作者删除!