Codota Logo
ObjectNode.putPOJO
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain ObjectNode
private void myMethod () {
ObjectNode o =
  • Codota IconJsonNodeFactory instance;instance.objectNode()
  • Codota IconObjectMapper mapper;mapper.createObjectNode()
  • Codota IconArrayNode arrayNode;arrayNode.addObject()
  • Smart code suggestions by Codota
}
origin: org.apache.curator/curator-x-discovery-server

@Override
public void marshallJson(ObjectNode node, String fieldName, T payload) throws Exception
{
  if ( payload == null )
  {
    //noinspection unchecked
    payload = (T)payloadType.getRawType().newInstance();
  }
  
  node.putPOJO(fieldName, payload);
}
origin: Talend/components

public ObjectNode toJSONObject() {
  ObjectNode o = mapper.createObjectNode();
  for (Map.Entry<String, Object> header : headers.entrySet()) {
    o.putPOJO(header.getKey(), header.getValue());
  }
  return o;
}
origin: PeterKnego/LeanEngine-Server

private JsonNode toJSON(NativeObject object) {
  if (object == null) return null;
  ObjectNode result = JsonUtils.getObjectMapper().createObjectNode();
  for (Map.Entry<Object, Object> entry : object.entrySet()) {
    if (entry.getValue().getClass().equals(NativeObject.class)) {
      result.put((String) entry.getKey(), toJSON((NativeObject) entry.getValue()));
    } else if (entry.getValue().getClass().equals(NativeArray.class)) {
      result.put((String) entry.getKey(), toJSON((NativeArray) entry.getValue()));
    } else {
      result.putPOJO((String) entry.getKey(), entry.getValue());
    }
  }
  return result;
}
origin: Talend/components

public JsonNode toJSONObject() {
  ObjectNode o = mapper.createObjectNode();
  for (Map.Entry<String, Object> claim : claims.entrySet()) {
    if (CLAIM_AUDIENCE.equals(claim.getKey())) {
      // Serialize single audience list and string
      List<String> audList = getAudience();
      if (audList != null && !audList.isEmpty()) {
        if (audList.size() == 1) {
          o.put(CLAIM_AUDIENCE, audList.get(0));
        } else {
          ArrayNode audArray = mapper.createArrayNode();
          for (String aud : audList) {
            audArray.add(aud);
          }
          o.put(CLAIM_AUDIENCE, audArray);
        }
      }
    } else if (claim.getValue() != null) {
      o.putPOJO(claim.getKey(), claim.getValue());
    }
  }
  return o;
}
origin: PeterKnego/LeanEngine-Server

public static JsonNode entityToJson(Entity entity) throws LeanException {
  ObjectNode json = getObjectMapper().createObjectNode();
  json.put("_id", entity.getKey().getId());
  json.putPOJO("_kind", entity.getKind());
  json.putPOJO("_account", entity.getProperty("_account"));
  Map<String, Object> props = entity.getProperties();
  for (Map.Entry<String, Object> prop : props.entrySet()) {
    addTypedNode(json, prop.getKey(), prop.getValue());
  }
  return json;
}
org.codehaus.jackson.nodeObjectNodeputPOJO

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
  • putObject
    Method that will construct an ObjectNode and add it as a field of this ObjectNode, replacing old val
  • arrayNode,
  • putObject,
  • nullNode,
  • path,
  • putNull,
  • POJONode,
  • _put,
  • binaryNode,
  • booleanNode,
  • equals

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now