src/main/java/com/cedarsoftware/util/io/ObjectResolver.java
public void traverseFields(final Deque<JsonObject<String, Object>> stack, final JsonObject<String, Object> jsonObj)
    {
        final Object javaMate = jsonObj.target;
        final Iterator<Map.Entry<String, Object>> i = jsonObj.entrySet().iterator();
        final Class cls = javaMate.getClass();

        while (i.hasNext())
        {
            Map.Entry<String, Object> e = i.next();
            String key = e.getKey();
            final Field field = MetaUtils.getField(cls, key);
            Object rhs = e.getValue();
            if (field != null)
            {
                assignField(stack, jsonObj, field, rhs);
            }
            else if (missingFieldHandler != null)
            {
                handleMissingField(stack, jsonObj, rhs, key);
            }//else no handler so ignor.
        }
    }
public void traverseFields(final Deque<JsonObject<String, Object>> stack, final JsonObject<String, Object> jsonObj)
    {
        final Object javaMate = jsonObj.target;
        final Iterator<Map.Entry<String, Object>> i = jsonObj.entrySet().iterator();
        final Class cls = javaMate.getClass();

        while (i.hasNext())
        {
            Map.Entry<String, Object> e = i.next();
            String key = e.getKey();
            final Field field = MetaUtils.getField(cls, key);
            Object rhs = e.getValue();
            if (field != null)
            {
                assignField(stack, jsonObj, field, rhs);
            }
            else if (missingFieldHandler != null)
            {
                handleMissingField(stack, jsonObj, rhs, key);
            }//else no handler so ignor.
        }
    }
public void traverseFields ( final Deque < JsonObject < String , Object > > stack , final JsonObject < String , Object > jsonObj ) { final Object javaMate = jsonObj . target ; final Iterator < Map . Entry < String , Object > > i = jsonObj . entrySet ( ) . iterator ( ) ; final Class cls = javaMate . getClass ( ) ; while ( i . hasNext ( ) ) { Map . Entry < String , Object > e = i . next ( ) ; String key = e . getKey ( ) ; final Field field = MetaUtils . getField ( cls , key ) ; Object rhs = e . getValue ( ) ; if ( field != null ) { assignField ( stack , jsonObj , field , rhs ) ; } else if ( missingFieldHandler != null ) { handleMissingField ( stack , jsonObj , rhs , key ) ; } //else no handler so ignor. } }
Walk the Java object fields and copy them from the JSON object to the Java object, performing
any necessary conversions on primitives, or deep traversals for field assignments to other objects,
arrays, Collections, or Maps.
@param stack   Stack (Deque) used for graph traversal.
@param jsonObj a Map-of-Map representation of the current object being examined (containing all fields).
Walk the Java object fields and copy them from the JSON object to the Java object performing any necessary conversions on primitives or deep traversals for field assignments to other objects arrays Collections or Maps .