本文整理汇总了Java中org.codehaus.jackson.node.JsonNodeFactory.objectNode方法的典型用法代码示例。如果您正苦于以下问题:Java JsonNodeFactory.objectNode方法的具体用法?Java JsonNodeFactory.objectNode怎么用?Java JsonNodeFactory.objectNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.jackson.node.JsonNodeFactory
的用法示例。
在下文中一共展示了JsonNodeFactory.objectNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAuthLinkResponse
import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
public static String createAuthLinkResponse(){
JsonNodeFactory f = JsonNodeFactory.instance ;
ObjectNode loginResponse = f.objectNode();
loginResponse.put("text","Authorization for SkyGiraffe to use Slack details is required.");
ArrayNode attachments = loginResponse.putArray("attachments");
ObjectNode att = f.objectNode();
att.put("fallback", "Please authorize SkyGiraffe to access to your Slack details ...");
att.put("pretext", "");
att.put("title", "Please authorize..");
att.put("title_link", Config.getPropertyValue("SLACK_AUTH_URL_DEV"));
att.put("text","Once authorized and logged into SkyGiraffe try '/sg help' to see all commands");
att.put("color", "#7CD197");
attachments.add(att);
return loginResponse.toString();
}
示例2: createLoginLinkResponse
import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
/**
* {
"attachments": [
{
"fallback": "Please login into SkyGiraffe to continue ...",
"pretext": "SkyGiraffe Login",
"title": "Please login into SkyGiraffe to continue ...",
"title_link": "https://sgbot-mobilityai.rhcloud.com/SGbot-1.0/skyg/login?key=",
"text": "Once logged in try '/sg help' to see all commands",
"color": "#7CD197"
}
]
}
* @return
*/
public static String createLoginLinkResponse(String slackUserId, String email, String teamId){
JsonNodeFactory f = JsonNodeFactory.instance ;
ObjectNode loginResponse = f.objectNode();
loginResponse.put("text","Login to SkyGiraffe is required.");
ArrayNode attachments = loginResponse.putArray("attachments");
ObjectNode att = f.objectNode();
att.put("fallback", "Please login into SkyGiraffe to continue ...");
att.put("pretext", "");
att.put("title", "Please login..");
att.put("title_link", Config.getPropertyValue("SGDS_LOGIN_URL_DEV")+slackUserId+"&EMAIL="+email+"&TEAMID="+teamId);
att.put("text","Once logged in try '/sg help' to see all commands");
att.put("color", "#7CD197");
attachments.add(att);
return loginResponse.toString();
}
示例3: getParameterList
import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
public static String getParameterList(String sessionId, String appId, String repId, String repUpId) throws IOException {
//
if (sessionId == null || sessionId.isEmpty())
throw new IllegalArgumentException("Session Id is empty. Please login.");
HttpPost postRequest = new HttpPost("https://wspublisherv2https.skygiraffe.com/WSPublisherV2.svc/GetReport_ParametersMainScreen4");
// add header
postRequest.setHeader("Content-Type", "application/json");
JsonNodeFactory f = JsonNodeFactory.instance;
ObjectNode o = f.objectNode();
o.put("ApplicationID", appId);
o.put("ReportID", repId);
o.put("TabID","");
ArrayNode diuId = f.arrayNode();
diuId = o.putArray("DataItemUpdateIDs");
o.put("ReportUpdateID",repUpId);
o.put("RequestID",sessionId);
o.put("SessionID",sessionId);
StringEntity inputApps = new StringEntity(o.toString());
inputApps.setContentType("application/json");
postRequest.setEntity(inputApps);
CloseableHttpResponse responseParams = getHttpClient().execute(postRequest);
String paramStr = "";
try {
HttpEntity entityApps = responseParams.getEntity();
paramStr = EntityUtils.toString(entityApps, "UTF-8");
EntityUtils.consume(entityApps);
}finally{
responseParams.close();
}
logger.debug("Params = "+paramStr);
return paramStr;
}