congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ObjectNode.getFields
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.codehaus.jackson/jackson-mapper-asl

public Object(JsonNode n, NodeCursor p)
{
  super(JsonStreamContext.TYPE_OBJECT, p);
  _contents = ((ObjectNode) n).getFields();
  _needEntry = true;
}
origin: camunda/camunda-bpm-platform

public Object(JsonNode n, NodeCursor p)
{
  super(JsonStreamContext.TYPE_OBJECT, p);
  _contents = ((ObjectNode) n).getFields();
  _needEntry = true;
}
origin: com.barchart.wrap/barchart-wrap-jackson

public Object(JsonNode n, NodeCursor p)
{
  super(JsonStreamContext.TYPE_OBJECT, p);
  _contents = ((ObjectNode) n).getFields();
  _needEntry = true;
}
origin: org.codehaus.jackson/jackson-mapper-lgpl

public Object(JsonNode n, NodeCursor p)
{
  super(JsonStreamContext.TYPE_OBJECT, p);
  _contents = ((ObjectNode) n).getFields();
  _needEntry = true;
}
origin: ovea-deprecated/jetty-session-redis

public Object(JsonNode n, NodeCursor p)
{
  super(JsonStreamContext.TYPE_OBJECT, p);
  _contents = ((ObjectNode) n).getFields();
  _needEntry = true;
}
origin: stackoverflow.com

 public class AnnotationDeserializer extends StdDeserializer<Annotation> {

AnnotationDeserializer() {
  super(Annotation.class);
}

@Override
public Annotation deserialize(JsonParser jp, DeserializationContext ctxt)
    throws IOException, JsonProcessingException {

  ObjectMapper mapper = (ObjectMapper) jp.getCodec();
  ObjectNode root = (ObjectNode) mapper.readTree(jp);
  Class<? extends Annotation> realClass = null;

  Iterator<Entry<String, JsonNode>> elementsIterator = root.getFields();
  while (elementsIterator.hasNext()) {
    Entry<String, JsonNode> element = elementsIterator.next();
    if ("type".equals(element.getKey())) {
      realClass = AnnotationObjectFactory.getInstance()
          .getAnnotationClass(element.getKey());
      break;
    }
  }

  if (realClass == null)
    return null;
  return mapper.readValue(root, realClass);
}
}
origin: stackoverflow.com

Iterator<Entry<String, JsonNode>> iterator = root.getFields();  
boolean found = false;
while (!found &&iterator.hasNext()) {  
origin: stackoverflow.com

 public class MyDeserializer extends JsonDeserializer< Message >
{
@Override
public Message deserialize( JsonParser jp, DeserializationContext arg1 ) throws IOException,
    JsonProcessingException
{
  ObjectMapper mapper = (ObjectMapper) jp.getCodec();  
  ObjectNode root = (ObjectNode) mapper.readTree(jp);  
  Class<? extends Message> subClass = null;  
  Iterator<Entry<String, JsonNode>> elementsIterator = root.getFields();  
  while (elementsIterator.hasNext())  
  {  
   Entry<String, JsonNode> element = elementsIterator.next();  
   String name = element.getKey();  
   if ("foo_id".equals(name))  
   {  
     if(element.getValue().isInt())
      subClass = FooInteger.Class;  
     break;  
   }  
  }  
  if (subClass == null) return null;  
  return mapper.readValue(root, subClass);    
}
}
origin: gravel-st/gravel

public static Map<String, Object> parseAsJSONValue(String src) {
  ObjectMapper mapper = new ObjectMapper();
  ObjectNode rootNode;
  try {
    rootNode = (ObjectNode) mapper.readValue(src, JsonNode.class);
  } catch (JsonParseException e) {
    throw new RuntimeException(e);
  } catch (JsonMappingException e) {
    throw new RuntimeException(e);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
  HashMap<String, Object> map = new HashMap<String, Object>();
  for (Iterator<Entry<String, JsonNode>> iter = rootNode.getFields(); iter
      .hasNext();) {
    Entry<String, JsonNode> field = iter.next();
    JsonNode value = field.getValue();
    Object o = jsonNodeAsSimpleObject(value);
    map.put(field.getKey(), o);
  }
  return map;
}
origin: com.github.foodev/jsondiff

@Override
public Collection<? extends Entry<String, JzonElement>> entrySet() {
  HashSet<Entry<String, JzonElement>> jset = new HashSet<Entry<String, JzonElement>>();
  for (Iterator<Entry<String, JsonNode>> i = wrapped.getFields(); i.hasNext();) {
    final Entry<String, JsonNode> e = i.next();
    final JzonElement el = JacksonWrapper.wrap(e.getValue());
    jset.add(new Entry<String, JzonElement>() {
      @Override
      public String getKey() {
        return e.getKey();
      }
      @Override
      public JzonElement getValue() {
        return el;
      }
      @Override
      public JzonElement setValue(JzonElement value) {
        throw new UnsupportedOperationException();
      }
    });
  }
  return jset;
}
origin: sirensolutions/siren

/**
 * The generateFacetsForLeaves() method for processing json objects, delegates for each field and constructs path.
 */
private void generateFacetsForLeaves(ObjectNode object, String fieldName, ExtendedJsonField sirenField, String path,
  List<SirenFacetEntry> facets) {
 Iterator<Entry<String, JsonNode>> iterator = object.getFields();
 while (iterator.hasNext()) {
  Entry<String, JsonNode> entry = iterator.next();
  String field = entry.getKey();
  JsonNode value = entry.getValue();
  if (field.equals("_datatype_") || field.equals("_value_")) {
   generateFacetsForCustomDatatypeLeaf(object, fieldName, sirenField, path, facets);
   return;
  }
  generateFacetsForLeaves(value, fieldName, sirenField, path.isEmpty() ? field : path + "." + field, facets);
 }
}
origin: algesten/jsondiff

@Override
public Collection<? extends Entry<String, JzonElement>> entrySet() {
  HashSet<Entry<String, JzonElement>> jset = new HashSet<Entry<String, JzonElement>>();
  for (Iterator<Entry<String, JsonNode>> i = wrapped.getFields(); i.hasNext();) {
    final Entry<String, JsonNode> e = i.next();
    final JzonElement el = JacksonWrapper.wrap(e.getValue());
    jset.add(new Entry<String, JzonElement>() {
      @Override
      public String getKey() {
        return e.getKey();
      }
      @Override
      public JzonElement getValue() {
        return el;
      }
      @Override
      public JzonElement setValue(JzonElement value) {
        throw new UnsupportedOperationException();
      }
    });
  }
  return jset;
}
origin: com.googlecode.etl-unit/json-validator

  private void validatePatternProperties(ObjectNode node, JsonSchemaObjectNode schema, String path) throws JsonSchemaValidationException
  {
    // iterate through all patterns, and apply to every property for validation
    for (Map.Entry<Pattern, JsonSchemaObjectNode> patternSchema : schema.getPatternPropertySchemas().entrySet())
    {
      Pattern keyPattern = patternSchema.getKey();
      JsonSchemaObjectNode keySchema = patternSchema.getValue();

      Iterator<Map.Entry<String, JsonNode>> fields = node.getFields();
      while (fields.hasNext())
      {
        Map.Entry<String, JsonNode> field = fields.next();

        // check for a pattern match
        if (keyPattern.matcher(field.getKey()).matches())
        {
          // this property matches the pattern, apply the schema
          validate(field.getValue(), keySchema, path);
        }
      }
    }
  }
}
origin: NGDATA/lilyproject

public static Configuration getHBaseConfiguration(ZooKeeperItf zk) {
  try {
    Configuration configuration = HBaseConfiguration.create();
    // Make this configuration object 'owned' by us: this way we can close the associated
    // connection completely without worrying we close someone else's connection (e.g.
    // when running two LilyClient's in one JVM, or when running LilyClient from within
    // the lily-server JVM, which is the case when we launch a batch build job)
    configuration.set(HConstants.HBASE_CLIENT_INSTANCE_ID, String.valueOf("lilyclient-" + hbaseConfCounter.incrementAndGet()));
    byte[] data = zk.getData(hbaseConfigPath, false, new Stat());
    ObjectNode propertiesNode = (ObjectNode) JsonFormat.deserializeSoft(data, "HBase configuration");
    Iterator<Map.Entry<String, JsonNode>> it = propertiesNode.getFields();
    while (it.hasNext()) {
      Map.Entry<String, JsonNode> entry = it.next();
      configuration.set(entry.getKey(), entry.getValue().getTextValue());
    }
    return configuration;
  } catch (Exception e) {
    throw new RuntimeException("Failed to get HBase configuration from ZooKeeper", e);
  }
}
origin: de.mhus.lib/mhu-lib-core

@Override
public List<IConfig> getNodes() {
  LinkedList<IConfig> out = new LinkedList<>();
  for ( Map.Entry<String, JsonNode> entry : MCollection.iterate(node.getFields()) ) {
    JsonNode child = entry.getValue();
    String childName = entry.getKey();
    if (child !=null && child.isArray()) {
      for (int i = 0; i < child.size(); i++)
        out.add( new JsonConfig(childName, this, child.get(i)));
    } else
    if (child !=null && child.isObject())
      out.add( new JsonConfig(childName, this, child));
  }
  return out;
}

origin: NGDATA/lilyproject

public static Namespaces fromJson(ObjectNode nsNode) throws JsonFormatException {
  Namespaces namespaces = new NamespacesImpl();
  Iterator<Map.Entry<String, JsonNode>> fieldsIt = nsNode.getFields();
  while (fieldsIt.hasNext()) {
    Map.Entry<String, JsonNode> entry = fieldsIt.next();
    String namespace = entry.getKey();
    String prefix;
    if (!entry.getValue().isTextual()) {
      throw new JsonFormatException("Namespace property should map to a string prefix. Namespace: " +
          namespace);
    } else {
      prefix = entry.getValue().getTextValue();
    }
    // addMapping will validate that the same prefix is not already bound to another namespace.
    namespaces.addMapping(prefix, namespace);
  }
  return namespaces;
}
origin: NGDATA/lilyproject

  @Override
  public RecordVariantFilter fromJson(JsonNode node, Namespaces namespaces, LRepository repository,
                    RecordFilterJsonConverter<RecordFilter> converter)
      throws JsonFormatException, RepositoryException, InterruptedException {

    String recordId = JsonUtil.getString(node, "recordId", null);
    if (recordId == null) {
      throw new IllegalStateException("expected non null recordId in json input");
    }

    final ObjectNode variantPropertiesNode = JsonUtil.getObject(node, "variantProperties", null);
    if (variantPropertiesNode == null) {
      throw new IllegalStateException("expected non null variantProperties in json input");
    }

    final HashMap<String, String> variantProperties = new HashMap<String, String>();

    final Iterator<Map.Entry<String, JsonNode>> fields = variantPropertiesNode.getFields();
    while (fields.hasNext()) {
      final Map.Entry<String, JsonNode> next = fields.next();
      variantProperties.put(next.getKey(), next.getValue().getTextValue());
    }
    return new RecordVariantFilter(repository.getIdGenerator().fromString(recordId), variantProperties);
  }
}
origin: com.googlecode.etl-unit/etlunit-core

Iterator<Map.Entry<String, JsonNode>> fields = on.getFields();
origin: NGDATA/lilyproject

public IndexDefinition(String name, ObjectNode jsonObject) {
  this.name = name;
  if (jsonObject.get("identifierOrder") != null) {
    setIdentifierOrder(Order.valueOf(jsonObject.get("identifierOrder").getTextValue()));
  } else {
    setIdentifierOrder(Order.ASCENDING);
  }
  try {
    ObjectNode fields = (ObjectNode) jsonObject.get("fields");
    Iterator<Map.Entry<String, JsonNode>> fieldsIt = fields.getFields();
    while (fieldsIt.hasNext()) {
      Map.Entry<String, JsonNode> entry = fieldsIt.next();
      String className = entry.getValue().get("class").getTextValue();
      Class<IndexFieldDefinition> clazz =
          (Class<IndexFieldDefinition>) getClass().getClassLoader().loadClass(className);
      Constructor<IndexFieldDefinition> constructor = clazz.getConstructor(String.class, ObjectNode.class);
      IndexFieldDefinition field = constructor.newInstance(entry.getKey(), entry.getValue());
      add(field);
    }
  } catch (Exception e) {
    throw new RuntimeException("Error instantiating IndexDefinition.", e);
  }
}
origin: CryptoWorldChain/ewallet

  public static FieldsMapperBean genQueryMapper(String json) {
    FieldsMapperBean fmb = new FieldsMapperBean();
    ObjectNode node = JsonUtil.toObjectNode(json);
    Iterator<Map.Entry<String, JsonNode>> iter = node.getFields();
    while (iter.hasNext()) {
      Entry<String, JsonNode> entry = iter.next();
      String key = entry.getKey();
      JsonNode value = entry.getValue();
      SearchField sf = new SearchField();
      sf.setFieldName(key);
      sf.setShow(value.asInt());
      fmb.getFields().add(sf);
    }
    return fmb;
  }
}
org.codehaus.jackson.nodeObjectNodegetFields

Javadoc

Method to use for accessing all fields (with both names and values) of this JSON Object.

Popular methods of ObjectNode

  • put
    Method for setting value of a field to specified binary value
  • get
  • 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
  • nullNode
  • putObject,
  • nullNode,
  • path,
  • putNull,
  • POJONode,
  • _put,
  • binaryNode,
  • booleanNode,
  • equals

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
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