Tabnine Logo
ObjectNode.putObject
Code IndexAdd Tabnine to your IDE (free)

How to use
putObject
method
in
org.codehaus.jackson.node.ObjectNode

Best Java code snippets using org.codehaus.jackson.node.ObjectNode.putObject (Showing top 18 results out of 315)

origin: org.fusesource.eca/eca-core

private void processMap(ObjectMapper mapper, ObjectNode root, Map<String, List<CacheItem<Exchange>>> map) throws IOException {
  for (Map.Entry<String, List<CacheItem<Exchange>>> entry : map.entrySet()) {
    ObjectNode rootList = root.putObject(entry.getKey());
    List<CacheItem<Exchange>> cl = entry.getValue();
    for (CacheItem<Exchange> item : cl) {
      processExchange(mapper, rootList, item);
    }
  }
}
origin: org.fusesource.eca/eca-core

public String calculateStatistics(Exchange exchange) throws Exception {
  ObjectMapper objectMapper = new ObjectMapper();
  ObjectNode objectNode = objectMapper.createObjectNode();
  ObjectNode statsNode = objectNode.putObject("statistics");
  if (this.expressionDefinitions != null && this.expressionDefinitions.length > 0) {
    for (ExpressionDefinition expressionDefinition : expressionDefinitions) {
      ObjectNode expressionNode = statsNode.putObject(expressionDefinition.getExpression());
      process(expressionDefinition, exchange, expressionNode);
    }
  } else {
    Map<String, Number> map = getNumbersFromExchange(exchange);
    if (map != null) {
      for (Map.Entry<String, Number> entry : map.entrySet()) {
        ObjectNode valueNode = statsNode.putObject(entry.getKey());
        try {
          process(entry.getValue(), valueNode);
        } catch (Throwable e) {
          LOG.error("Failed to process statistics on " + exchange + " for parameter " + entry.getKey() + " = " + entry.getValue(), e);
        }
      }
    }
  }
  return objectNode.toString();
}
origin: org.fusesource.eca/eca-core

private void processExchange(ObjectMapper mapper, ObjectNode root, CacheItem<Exchange> item) throws IOException {
  Exchange exchange = item.getItem();
  long timeStamp = item.getTimestamp();
  ObjectNode exchangeNode = root.putObject(exchange.getExchangeId());
  exchangeNode.put("timestamp", timeStamp);
  Object payload = exchange.getIn().getBody();
  String payloadString = mapper.writeValueAsString(payload);
  exchangeNode.put("payload", payloadString);
}
origin: org.fusesource.eca/eca-core

protected String processList(List<CacheItem<Exchange>> list) throws IOException {
  String result = null;
  if (list != null && !list.isEmpty()) {
    ObjectMapper objectMapper = new ObjectMapper();
    ObjectNode objectNode = objectMapper.createObjectNode();
    ObjectNode rootNode = objectNode.putObject("eca{" + getPattern() + "}");
    Map<String, List<CacheItem<Exchange>>> map = new LinkedHashMap<String, List<CacheItem<Exchange>>>(list.size());
    for (CacheItem<Exchange> item : list) {
      Exchange exchange = item.getItem();
      String routeId = exchange.getFromRouteId();
      List<CacheItem<Exchange>> cl = map.get(routeId);
      if (cl == null) {
        cl = new ArrayList<CacheItem<Exchange>>();
        map.put(routeId, cl);
      }
      cl.add(item);
    }
    processMap(objectMapper, rootNode, map);
    result = objectNode.toString();
  }
  return result;
}
origin: NGDATA/hbase-indexer

  private void setBatchBuildInfo(BatchBuildInfo buildInfo, ObjectNode batchNode) {
    batchNode.put("submitTime", buildInfo.getSubmitTime());
    Boolean isFinishedSuccessful = buildInfo.isFinishedSuccessful();
    if (isFinishedSuccessful == null) {
      batchNode.put("finishedSuccessful", batchNode.nullNode());
    } else {
      batchNode.put("finishedSuccessful", isFinishedSuccessful);          
    }
    ObjectNode jobs = batchNode.putObject("mapReduceJobTrackingUrls");
    for (Map.Entry<String, String> entry : buildInfo.getMapReduceJobTrackingUrls().entrySet()) {
      jobs.put(entry.getKey(), entry.getValue());
    }
    setStringArrayProperty(batchNode, "batchIndexCliArguments", buildInfo.getBatchIndexCliArguments());
  }
}
origin: com.ngdata/hbase-indexer-model

  private void setBatchBuildInfo(BatchBuildInfo buildInfo, ObjectNode batchNode) {
    batchNode.put("submitTime", buildInfo.getSubmitTime());
    Boolean isFinishedSuccessful = buildInfo.isFinishedSuccessful();
    if (isFinishedSuccessful == null) {
      batchNode.put("finishedSuccessful", batchNode.nullNode());
    } else {
      batchNode.put("finishedSuccessful", isFinishedSuccessful);          
    }
    ObjectNode jobs = batchNode.putObject("mapReduceJobTrackingUrls");
    for (Map.Entry<String, String> entry : buildInfo.getMapReduceJobTrackingUrls().entrySet()) {
      jobs.put(entry.getKey(), entry.getValue());
    }
    setStringArrayProperty(batchNode, "batchIndexCliArguments", buildInfo.getBatchIndexCliArguments());
  }
}
origin: NGDATA/lilyproject

ObjectNode fieldsNode = recordNode.putObject("fields");
  schemaNode = recordNode.putObject("schema");
ObjectNode attributesNode = recordNode.putObject("attributes");
for (String key : attributes.keySet()) {
  attributesNode.put(key, attributes.get(key));
ObjectNode metadatasNode = recordNode.putObject("metadata");
  ObjectNode metadataNode = metadatasNode.putObject(fieldName);
      metadataNode.put(metadata.getKey(), (Boolean)value);
    } else if (value instanceof ByteArray) {
      ObjectNode binaryNode = metadataNode.putObject(metadata.getKey());
      binaryNode.put("type", "binary");
      binaryNode.put("value", ((ByteArray)value).getBytes());
    } else if (value instanceof DateTime){
      ObjectNode dateTimeNode = metadataNode.putObject(metadata.getKey());
      dateTimeNode.put("type", "datetime");
      dateTimeNode.put("value", value.toString());
  if (!fieldsToDelete.isEmpty()) {
    if (metadataToDeleteNode == null) {
      metadataToDeleteNode = recordNode.putObject("metadataToDelete");
origin: NGDATA/lilyproject

public ObjectNode toJson() {
  JsonNodeFactory factory = JsonNodeFactory.instance;
  ObjectNode object = factory.objectNode();
  ObjectNode fieldsJson = object.putObject("fields");
  for (IndexFieldDefinition field : fields) {
    fieldsJson.put(field.getName(), field.toJson());
  }
  object.put("identifierOrder", this.identifierIndexFieldDefinition.getOrder().toString());
  return object;
}
origin: apache/apex-malhar

public static ViewQuery createAndFetchViewQuery()
{
 if (!connector.contains(DESIGN_DOC_ID)) {
  //The design document doesn't exist in the database so we create it.
  JsonNode rootNode = mapper.createObjectNode();
  ((ObjectNode)rootNode).put("language", "javascript");
  ((ObjectNode)rootNode).putObject("views").putObject(TEST_VIEW).put("map", "function(doc) {\n  emit(doc._id, doc);\n}");
  connector.create(DESIGN_DOC_ID, rootNode);
 }
 return new ViewQuery().designDocId(DESIGN_DOC_ID).viewName(TEST_VIEW);
}
origin: NGDATA/hbase-indexer

ObjectNode paramsNode = node.putObject("connectionParams");
for (Map.Entry<String, String> entry : indexer.getConnectionParams().entrySet()) {
  paramsNode.put(entry.getKey(), entry.getValue());
ObjectNode batchNode = node.putObject("activeBatchBuild");
ObjectNode batchNode = node.putObject("lastBatchBuild");
origin: com.ngdata/hbase-indexer-model

ObjectNode paramsNode = node.putObject("connectionParams");
for (Map.Entry<String, String> entry : indexer.getConnectionParams().entrySet()) {
  paramsNode.put(entry.getKey(), entry.getValue());
ObjectNode batchNode = node.putObject("activeBatchBuild");
ObjectNode batchNode = node.putObject("lastBatchBuild");
origin: rdelbru/SIREn

@Override
ObjectNode toJson() {
 final ObjectNode obj = mapper.createObjectNode();
 final ObjectNode node = obj.putObject(NodePropertyParser.NODE_PROPERTY);
 node.put(QueryPropertyParser.QUERY_PROPERTY, booleanExpression);
 if (this.hasLevel()) {
  node.put(LevelPropertyParser.LEVEL_PROPERTY, this.getLevel());
 }
 if (this.hasRange()) {
  final ArrayNode array = node.putArray(RangePropertyParser.RANGE_PROPERTY);
  array.add(this.getLowerBound());
  array.add(this.getUpperBound());
 }
 if (this.hasBoost()) {
  node.put(BoostPropertyParser.BOOST_PROPERTY, this.getBoost());
 }
 return obj;
}
origin: sirensolutions/siren

@Override
public ObjectNode toJson() {
 final ObjectNode obj = mapper.createObjectNode();
 final ObjectNode node = obj.putObject(NodePropertyParser.NODE_PROPERTY);
 node.put(QueryPropertyParser.QUERY_PROPERTY, booleanExpression);
 if (this.hasLevel()) {
  node.put(LevelPropertyParser.LEVEL_PROPERTY, this.getLevel());
 }
 if (this.hasRange()) {
  final ArrayNode array = node.putArray(RangePropertyParser.RANGE_PROPERTY);
  array.add(this.getLowerBound());
  array.add(this.getUpperBound());
 }
 if (this.hasBoost()) {
  node.put(BoostPropertyParser.BOOST_PROPERTY, this.getBoost());
 }
 return obj;
}
origin: NGDATA/lilyproject

node.putObject("value");
origin: sirensolutions/siren

@Override
public ObjectNode toJson() {
 final ObjectNode obj = mapper.createObjectNode();
 ObjectNode bool = obj.putObject(BooleanPropertyParser.BOOLEAN_PROPERTY);
 // add boost
 if (this.hasBoost()) {
  bool.put(BoostPropertyParser.BOOST_PROPERTY, this.getBoost());
 }
 // add slop
 if (this.hasSlop()) {
  bool.put(SlopPropertyParser.SLOP_PROPERTY, this.getSlop());
 }
 // add inOrder
 if (this.hasInOrder()) {
  bool.put(InOrderPropertyParser.IN_ORDER_PROPERTY, this.getInOrder());
 }
 // add clauses
 ArrayNode array = bool.putArray(ClausePropertyParser.CLAUSE_PROPERTY);
 for (final QueryClause clause : clauses) {
  final ObjectNode e = array.addObject();
  e.put(OccurPropertyParser.OCCUR_PROPERTY, clause.getOccur().toString());
  e.putAll(clause.getQuery().toJson());
 }
 return obj;
}
origin: NGDATA/lilyproject

ObjectNode returnFieldsNode = node.putObject("returnFields");
returnFieldsNode.put("type", scan.getReturnFields().getType().toString());
if (scan.getReturnFields().getFields() != null) {
origin: sirensolutions/siren

@Override
public ObjectNode toJson() {
 final ObjectNode obj = mapper.createObjectNode();
 final ObjectNode twig = obj.putObject(TwigPropertyParser.TWIG_PROPERTY);
origin: rdelbru/SIREn

@Override
ObjectNode toJson() {
 final ObjectNode obj = mapper.createObjectNode();
 final ObjectNode twig = obj.putObject(TwigPropertyParser.TWIG_PROPERTY);
org.codehaus.jackson.nodeObjectNodeputObject

Javadoc

Method that will construct an ObjectNode and add it as a field of this ObjectNode, replacing old value, if any.

Popular methods of ObjectNode

  • put
    Method for setting value of a field to specified binary value
  • get
  • getFields
    Method to use for accessing all fields (with both names and values) of this JSON Object.
  • toString
  • putArray
    Method that will construct an ArrayNode and add it as a field of this ObjectNode, replacing old valu
  • has
  • remove
    Method for removing specified field properties out of this ObjectNode.
  • objectNode
  • size
  • <init>
  • arrayNode
  • nullNode
  • arrayNode,
  • nullNode,
  • path,
  • putNull,
  • POJONode,
  • _put,
  • binaryNode,
  • booleanNode,
  • equals

Popular in Java

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • findViewById (Activity)
  • setScale (BigDecimal)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now