src/main/java/com/cedarsoftware/util/io/ObjectResolver.java
protected void handleMissingField(final Deque<JsonObject<String, Object>> stack, final JsonObject jsonObj, final Object rhs,
                                      final String missingField)
    {
        final Object target = jsonObj.target;
        try
        {
            if (rhs == null)
            { // Logically clear field (allows null to be set against primitive fields, yielding their zero value.
                storeMissingField(target, missingField, null);
                return;
            }

            // we have a jsonobject with a type
            Object special;
            if (rhs == JsonParser.EMPTY_OBJECT)
            {
                storeMissingField(target, missingField, null);
            }
            else if ((special = readIfMatching(rhs, null, stack)) != null)
            {
                storeMissingField(target, missingField, special);
            }
            else if (rhs.getClass().isArray())
            {
                // impossible to determine the array type.
                storeMissingField(target, missingField, null);
            }
            else if (rhs instanceof JsonObject)
            {
                final JsonObject<String, Object> jObj = (JsonObject) rhs;
                final Long ref = jObj.getReferenceId();

                if (ref != null)
                { // Correct field references
                    final JsonObject refObject = getReferencedObj(ref);
                    storeMissingField(target, missingField, refObject.target);
                }
                else
                {   // Assign ObjectMap's to Object (or derived) fields
                    // check that jObj as a type
                    if (jObj.getType() != null)
                    {
                        Object createJavaObjectInstance = createJavaObjectInstance(null, jObj);
                        if (!MetaUtils.isLogicalPrimitive(jObj.getTargetClass()))
                        {
                            stack.addFirst((JsonObject) rhs);
                        }
                        storeMissingField(target, missingField, createJavaObjectInstance);
                    } 
                    else //no type found, just notify.
                    {
                        storeMissingField(target, missingField, null);
                    }
                }
            }
            else
            {
                storeMissingField(target, missingField, rhs);
            }
        }
        catch (Exception e)
        {
            String message = e.getClass().getSimpleName() + " missing field '" + missingField + "' on target: "
                    + safeToString(target) + " with value: " + rhs;
            if (MetaUtils.loadClassException != null)
            {
                message += " Caused by: " + MetaUtils.loadClassException
                        + " (which created a LinkedHashMap instead of the desired class)";
            }
            throw new JsonIoException(message, e);
        }
    }
protected void handleMissingField(final Deque<JsonObject<String, Object>> stack, final JsonObject jsonObj, final Object rhs,
                                      final String missingField)
    {
        final Object target = jsonObj.target;
        try
        {
            if (rhs == null)
            { // Logically clear field (allows null to be set against primitive fields, yielding their zero value.
                storeMissingField(target, missingField, null);
                return;
            }

            // we have a jsonobject with a type
            Object special;
            if (rhs == JsonParser.EMPTY_OBJECT)
            {
                storeMissingField(target, missingField, null);
            }
            else if ((special = readIfMatching(rhs, null, stack)) != null)
            {
                storeMissingField(target, missingField, special);
            }
            else if (rhs.getClass().isArray())
            {
                // impossible to determine the array type.
                storeMissingField(target, missingField, null);
            }
            else if (rhs instanceof JsonObject)
            {
                final JsonObject<String, Object> jObj = (JsonObject) rhs;
                final Long ref = jObj.getReferenceId();

                if (ref != null)
                { // Correct field references
                    final JsonObject refObject = getReferencedObj(ref);
                    storeMissingField(target, missingField, refObject.target);
                }
                else
                {   // Assign ObjectMap's to Object (or derived) fields
                    // check that jObj as a type
                    if (jObj.getType() != null)
                    {
                        Object createJavaObjectInstance = createJavaObjectInstance(null, jObj);
                        if (!MetaUtils.isLogicalPrimitive(jObj.getTargetClass()))
                        {
                            stack.addFirst((JsonObject) rhs);
                        }
                        storeMissingField(target, missingField, createJavaObjectInstance);
                    } 
                    else //no type found, just notify.
                    {
                        storeMissingField(target, missingField, null);
                    }
                }
            }
            else
            {
                storeMissingField(target, missingField, rhs);
            }
        }
        catch (Exception e)
        {
            String message = e.getClass().getSimpleName() + " missing field '" + missingField + "' on target: "
                    + safeToString(target) + " with value: " + rhs;
            if (MetaUtils.loadClassException != null)
            {
                message += " Caused by: " + MetaUtils.loadClassException
                        + " (which created a LinkedHashMap instead of the desired class)";
            }
            throw new JsonIoException(message, e);
        }
    }
protected void handleMissingField ( final Deque < JsonObject < String , Object > > stack , final JsonObject jsonObj , final Object rhs , final String missingField ) { final Object target = jsonObj . target ; try { if ( rhs == null ) { // Logically clear field (allows null to be set against primitive fields, yielding their zero value. storeMissingField ( target , missingField , null ) ; return ; } // we have a jsonobject with a type Object special ; if ( rhs == JsonParser . EMPTY_OBJECT ) { storeMissingField ( target , missingField , null ) ; } else if ( ( special = readIfMatching ( rhs , null , stack ) ) != null ) { storeMissingField ( target , missingField , special ) ; } else if ( rhs . getClass ( ) . isArray ( ) ) { // impossible to determine the array type. storeMissingField ( target , missingField , null ) ; } else if ( rhs instanceof JsonObject ) { final JsonObject < String , Object > jObj = ( JsonObject ) rhs ; final Long ref = jObj . getReferenceId ( ) ; if ( ref != null ) { // Correct field references final JsonObject refObject = getReferencedObj ( ref ) ; storeMissingField ( target , missingField , refObject . target ) ; } else { // Assign ObjectMap's to Object (or derived) fields // check that jObj as a type if ( jObj . getType ( ) != null ) { Object createJavaObjectInstance = createJavaObjectInstance ( null , jObj ) ; if ( ! MetaUtils . isLogicalPrimitive ( jObj . getTargetClass ( ) ) ) { stack . addFirst ( ( JsonObject ) rhs ) ; } storeMissingField ( target , missingField , createJavaObjectInstance ) ; } else //no type found, just notify. { storeMissingField ( target , missingField , null ) ; } } } else { storeMissingField ( target , missingField , rhs ) ; } } catch ( Exception e ) { String message = e . getClass ( ) . getSimpleName ( ) + " missing field '" + missingField + "' on target: " + safeToString ( target ) + " with value: " + rhs ; if ( MetaUtils . loadClassException != null ) { message += " Caused by: " + MetaUtils . loadClassException + " (which created a LinkedHashMap instead of the desired class)" ; } throw new JsonIoException ( message , e ) ; } }
Try to create an java object from the missing field.
Mosly primitive types and jsonObject that contains @type attribute will
be candidate for the missing field callback, others will be ignored.
All missing field are stored for later notification

@param stack Stack (Deque) used for graph traversal.
@param jsonObj a Map-of-Map representation of the current object being examined (containing all fields).
@param rhs the JSON value that will be converted and stored in the 'field' on the associated Java target object.
@param missingField name of the missing field in the java object.
Try to create an java object from the missing field . Mosly primitive types and jsonObject that contains @type attribute will be candidate for the missing field callback others will be ignored . All missing field are stored for later notification