当前位置: 首页>>代码示例>>Java>>正文


Java JsonNodeFactory.instance方法代码示例

本文整理汇总了Java中org.codehaus.jackson.node.JsonNodeFactory.instance方法的典型用法代码示例。如果您正苦于以下问题:Java JsonNodeFactory.instance方法的具体用法?Java JsonNodeFactory.instance怎么用?Java JsonNodeFactory.instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.jackson.node.JsonNodeFactory的用法示例。


在下文中一共展示了JsonNodeFactory.instance方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();

    }
 
开发者ID:skygiraffe,项目名称:skygiraffe-slackbot,代码行数:19,代码来源:JsonUtil.java

示例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();

}
 
开发者ID:skygiraffe,项目名称:skygiraffe-slackbot,代码行数:35,代码来源:JsonUtil.java

示例3: main

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
public static void main(String[] args)
{
    DependencyGraph g = new DependencyGraph();

    JsonNodeFactory nc = JsonNodeFactory.instance;

    JsonNode a = nc.numberNode(1);
    JsonNode b = nc.numberNode(2);
    JsonNode c = nc.numberNode(3);
    JsonNode d = nc.numberNode(4);
    JsonNode e = nc.numberNode(5);
    JsonNode f = nc.numberNode(6);
    JsonNode h = nc.numberNode(7);
    JsonNode i = nc.numberNode(8);

    g.addNode("input", null, a);
    g.addNode("loaddict", null, b);
    g.addNode("second", null, c);
    g.addNode("encode", Arrays.asList(new String[] { "input", "loaddict" }), d);
    g.addNode("groupby", Arrays.asList(new String[] { "encode" }), e);
    g.addNode("filter", Arrays.asList(new String[] { "groupby" }), f);
    g.addNode("join", Arrays.asList(new String[] { "filter", "second" }), h);
    g.addNode("shuffle", Arrays.asList(new String[] { "join" }), i);
    System.out.println(g.getSerialPlan());
}
 
开发者ID:linkedin,项目名称:Cubert,代码行数:26,代码来源:DependencyGraph.java

示例4: createHashJoinOperator

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
public HashJoinOperator createHashJoinOperator(BlockSchema lSchema,
                                               BlockSchema rSchema,
                                               BlockSchema operatorSchema,
                                               TupleStore lStore,
                                               TupleStore rStore) throws IOException, InterruptedException
{
    /* Create Blocks */
    final Block lBlock = new TupleStoreBlock(lStore, new BlockProperties(lBlockName, lSchema, (BlockProperties) null));
    final Block rBlock = new TupleStoreBlock(rStore, new BlockProperties(rBlockName, rSchema, (BlockProperties) null));

    /* Perform the Hash Join */
    Map<String, Block> input = new HashMap<String, Block>();
    input.put(lBlockName, lBlock);
    input.put(rBlockName, rBlock);

    ObjectNode root = new ObjectNode(JsonNodeFactory.instance);
    root.put("leftBlock", lBlockName);
    root.put("rightBlock", rBlockName);

    final ArrayNode joinKeys = new ArrayNode(JsonNodeFactory.instance);
    joinKeys.add("Integer");
    root.put("leftJoinKeys", joinKeys);
    root.put("rightJoinKeys", joinKeys);

    BlockProperties props = new BlockProperties("Joined", operatorSchema, (BlockProperties) null);
    HashJoinOperator operator = new HashJoinOperator();

    operator.setInput(input, root, props);
    return operator;
}
 
开发者ID:linkedin,项目名称:Cubert,代码行数:31,代码来源:TestHashJoinOperator.java

示例5: createOverrideStrategyField

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
/**
 * Creates the override strategy field.
 *
 * @return the field
 */
private Field createOverrideStrategyField() {
  List<String> overrideStrategySymbols = Arrays.asList(OverrideStrategy.APPEND.name(),
      OverrideStrategy.REPLACE.name());
  Schema overrideStrategyEnum = Schema.createEnum(OVERRIDE_STRATEGY_TYPE_NAME, null,
      BASE_SCHEMA_FORM_NAMESPACE, overrideStrategySymbols);
  Field overrideStrategyField = new Field(OVERRIDE_STRATEGY, Schema.createUnion(Arrays.asList(
      overrideStrategyEnum, Schema.create(Type.NULL))), null, null);
  overrideStrategyField.addProp(DISPLAY_NAME, "Override strategy");
  JsonNodeFactory jsonFactory = JsonNodeFactory.instance;
  ArrayNode displayNamesNode = jsonFactory.arrayNode();
  displayNamesNode.add(TextNode.valueOf("Append"));
  displayNamesNode.add(TextNode.valueOf("Replace"));
  overrideStrategyField.addProp(DISPLAY_NAMES, displayNamesNode);
  overrideStrategyField.addProp(DISPLAY_PROMPT, "Select array override strategy");
  return overrideStrategyField;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:22,代码来源:ConfigurationSchemaFormAvroConverter.java

示例6: createClassTypeField

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
/**
 * Creates the class type field.
 *
 * @return the field
 */
private Field createClassTypeField() {
  List<String> classTypeSymbols = Arrays.asList(OBJECT, EVENT);
  Schema classTypeEnum = Schema.createEnum(CLASS_TYPE_TYPE_NAME, null,
      BASE_SCHEMA_FORM_NAMESPACE, classTypeSymbols);
  Field classTypeField = new Field(CLASS_TYPE, classTypeEnum, null, null);
  classTypeField.addProp(DISPLAY_NAME, "Class type");
  JsonNodeFactory jsonFactory = JsonNodeFactory.instance;
  ArrayNode displayNamesNode = jsonFactory.arrayNode();
  displayNamesNode.add(TextNode.valueOf("Object"));
  displayNamesNode.add(TextNode.valueOf("Event"));
  classTypeField.addProp(DISPLAY_NAMES, displayNamesNode);
  classTypeField.addProp(DISPLAY_PROMPT, "Select class type");
  classTypeField.addProp(BY_DEFAULT, OBJECT);
  return classTypeField;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:21,代码来源:EcfSchemaFormAvroConverter.java

示例7: 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;
    }
 
开发者ID:skygiraffe,项目名称:skygiraffe-slackbot,代码行数:44,代码来源:SGDSClient.java

示例8: BaseTO

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
public BaseTO() {
	super();
	if (factory == null) {
		factory = JsonNodeFactory.instance;
		jsonMapper = new ObjectMapper();
	}// EOF if
}
 
开发者ID:oracle,项目名称:big-data-lite,代码行数:8,代码来源:BaseTO.java

示例9: createBytesJsonValue

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
/**
 * Creates the bytes json value.
 *
 * @param value the value
 * @return the array node
 * @throws ParseException the parse exception
 */
private static ArrayNode createBytesJsonValue(String value) throws ParseException {
    if (value != null) {
        JsonNodeFactory jsonFactory = JsonNodeFactory.instance;            
        ArrayNode bytesNode = jsonFactory.arrayNode();
        byte[] data = Base64Utils.fromBase64(value);
        for (int i=0;i<data.length;i++) {
            bytesNode.add(data[i]);
        }
        return bytesNode;
    } else {
        return null;
    }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:21,代码来源:SchemaFormAvroConverter.java

示例10: ObjectMapper

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
/**
 * 
 * @param jf JsonFactory to use: if null, a new {@link MappingJsonFactory} will be constructed
 * @param sp SerializerProvider to use: if null, a {@link StdSerializerProvider} will be constructed
 * @param dp DeserializerProvider to use: if null, a {@link StdDeserializerProvider} will be constructed
 * @param sconfig Serialization configuration to use; if null, basic {@link SerializationConfig}
 * 	will be constructed
 * @param dconfig Deserialization configuration to use; if null, basic {@link DeserializationConfig}
 * 	will be constructed
 */
public ObjectMapper(JsonFactory jf,
                    SerializerProvider sp, DeserializerProvider dp,
                   SerializationConfig sconfig, DeserializationConfig dconfig)
{
    /* 02-Mar-2009, tatu: Important: we MUST default to using
     *   the mapping factory, otherwise tree serialization will
     *   have problems with POJONodes.
     * 03-Jan-2010, tatu: and obviously we also must pass 'this',
     *    to create actual linking.
     */
    _jsonFactory = (jf == null) ? new MappingJsonFactory(this) : jf;
    // visibility checker; usually default
    _visibilityChecker = STD_VISIBILITY_CHECKER;
    _serializationConfig = (sconfig != null) ? sconfig :
        new SerializationConfig(DEFAULT_INTROSPECTOR, DEFAULT_ANNOTATION_INTROSPECTOR, _visibilityChecker);
    _deserializationConfig = (dconfig != null) ? dconfig :
        new DeserializationConfig(DEFAULT_INTROSPECTOR, DEFAULT_ANNOTATION_INTROSPECTOR, _visibilityChecker);
    _serializerProvider = (sp == null) ? new StdSerializerProvider() : sp;
    _deserializerProvider = (dp == null) ? new StdDeserializerProvider() : dp;

    // Default serializer factory is stateless, can just assign
    _serializerFactory = BeanSerializerFactory.instance;

    // and use standard JsonNodeFactory initially
    _nodeFactory = JsonNodeFactory.instance;

}
 
开发者ID:r00li,项目名称:RHome,代码行数:38,代码来源:ObjectMapper.java

示例11: newNode

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
protected ObjectNode newNode() {
    return new ObjectNode(JsonNodeFactory.instance);
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:4,代码来源:VapiClient.java

示例12: DeserializationConfig

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
public DeserializationConfig(ClassIntrospector<? extends BeanDescription> paramClassIntrospector, AnnotationIntrospector paramAnnotationIntrospector, VisibilityChecker<?> paramVisibilityChecker, SubtypeResolver paramSubtypeResolver, PropertyNamingStrategy paramPropertyNamingStrategy, TypeFactory paramTypeFactory, HandlerInstantiator paramHandlerInstantiator)
{
  super(paramClassIntrospector, paramAnnotationIntrospector, paramVisibilityChecker, paramSubtypeResolver, paramPropertyNamingStrategy, paramTypeFactory, paramHandlerInstantiator);
  this._nodeFactory = JsonNodeFactory.instance;
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:6,代码来源:DeserializationConfig.java

示例13: DeserializationConfig

import org.codehaus.jackson.node.JsonNodeFactory; //导入方法依赖的package包/类
public DeserializationConfig(ClassIntrospector<? extends BeanDescription> paramClassIntrospector, AnnotationIntrospector paramAnnotationIntrospector, VisibilityChecker<?> paramVisibilityChecker, SubtypeResolver paramSubtypeResolver, PropertyNamingStrategy paramPropertyNamingStrategy, TypeFactory paramTypeFactory, HandlerInstantiator paramHandlerInstantiator)
{
  super(paramClassIntrospector, paramAnnotationIntrospector, paramVisibilityChecker, paramSubtypeResolver, paramPropertyNamingStrategy, paramTypeFactory, paramHandlerInstantiator, collectFeatureDefaults(DeserializationConfig.Feature.class));
  this._nodeFactory = JsonNodeFactory.instance;
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:6,代码来源:DeserializationConfig.java


注:本文中的org.codehaus.jackson.node.JsonNodeFactory.instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。