boon/src/main/java/org/boon/core/reflection/MapperComplex.java
@Override
    public  <T> T fromMap(final Map<String, Object> map, final Class<T> cls) {


        T toObject = Reflection.newInstance( cls );
        Map<String, FieldAccess> fields = fieldsAccessor.getFields( toObject.getClass() );
        Set<Map.Entry<String, Object>> mapKeyValuesEntrySet = map.entrySet();


        /* Iterate through the map keys/values. */
        for ( Map.Entry<String, Object> mapEntry : mapKeyValuesEntrySet ) {

            /* Get the field name. */
            String key = mapEntry.getKey();

            if ( ignoreSet != null ) {
                if ( ignoreSet.contains( key ) ) {
                    continue;
                }
            }

            /* Get the field and if it missing then ignore this map entry. */
            FieldAccess field = fields.get( fieldsAccessor.isCaseInsensitive() ? key.toLowerCase() : key );


            if ( field == null ) {
                continue;
            }



            /* Check the view if it is active. */
            if ( view != null ) {
                if ( !field.isViewActive( view ) ) {
                    continue;
                }
            }


            /* Check respects ignore is active.
             * Then needs to be a chain of responsibilities.
             * */
            if ( respectIgnore ) {
                if ( field.ignore() ) {
                    continue;
                }
            }

            /* Get the value from the map. */
            Object value = mapEntry.getValue();


            /* If the value is a Value (a index overlay), then convert ensure it is not a container and inject
            it into the field, and we are done so continue.
             */
            if ( value instanceof Value ) {
                if ( ( ( Value ) value ).isContainer() ) {
                    value = ( ( Value ) value ).toValue();
                } else {
                    field.setFromValue( toObject, ( Value ) value );
                    continue;
                }
            }

            /* If the value is null, then inject an null value into the field.
            * Notice we do not check to see if the field is a primitive, if
            * it is we die which is the expected behavior.
            */
            if ( value == null ) {
                field.setObject( toObject, null );
                continue;
            }

            /* if the value's type and the field type are the same or
            the field just takes an object, then inject what we have as is.
             */
            if ( value.getClass() == field.type() || field.type() == Object.class) {
                field.setValue(toObject, value);
            } else if ( Typ.isBasicType(value) ) {

                field.setValue(toObject, value);
            }


            /* See if it is a map<string, object>, and if it is then process it.
             *  REFACTOR:
             *  It looks like we are using some utility classes here that we could have used in
             *  oldMatchAndConvertArgs.
             *  REFACTOR
              * */
            else if ( value instanceof Map ) {
                setFieldValueFromMap(toObject, field, (Map)value);
            } else if ( value instanceof Collection) {
                /*It is a collection so process it that way. */
                processCollectionFromMapUsingFields( toObject, field, ( Collection ) value);
            } else if ( value instanceof Map[] ) {
                /* It is an array of maps so, we need to process it as such. */
                processArrayOfMaps(toObject, field, ( Map<String, Object>[] )value );
            } else {
                /* If we could not determine how to convert it into some field
                object then we just go ahead an inject it using setValue which
                will call Conversion.coerce.
                 */
                field.setValue( toObject, value );
            }

        }

        return toObject;

    }
@Override
    public  <T> T fromMap(final Map<String, Object> map, final Class<T> cls) {


        T toObject = Reflection.newInstance( cls );
        Map<String, FieldAccess> fields = fieldsAccessor.getFields( toObject.getClass() );
        Set<Map.Entry<String, Object>> mapKeyValuesEntrySet = map.entrySet();


        /* Iterate through the map keys/values. */
        for ( Map.Entry<String, Object> mapEntry : mapKeyValuesEntrySet ) {

            /* Get the field name. */
            String key = mapEntry.getKey();

            if ( ignoreSet != null ) {
                if ( ignoreSet.contains( key ) ) {
                    continue;
                }
            }

            /* Get the field and if it missing then ignore this map entry. */
            FieldAccess field = fields.get( fieldsAccessor.isCaseInsensitive() ? key.toLowerCase() : key );


            if ( field == null ) {
                continue;
            }



            /* Check the view if it is active. */
            if ( view != null ) {
                if ( !field.isViewActive( view ) ) {
                    continue;
                }
            }


            /* Check respects ignore is active.
             * Then needs to be a chain of responsibilities.
             * */
            if ( respectIgnore ) {
                if ( field.ignore() ) {
                    continue;
                }
            }

            /* Get the value from the map. */
            Object value = mapEntry.getValue();


            /* If the value is a Value (a index overlay), then convert ensure it is not a container and inject
            it into the field, and we are done so continue.
             */
            if ( value instanceof Value ) {
                if ( ( ( Value ) value ).isContainer() ) {
                    value = ( ( Value ) value ).toValue();
                } else {
                    field.setFromValue( toObject, ( Value ) value );
                    continue;
                }
            }

            /* If the value is null, then inject an null value into the field.
            * Notice we do not check to see if the field is a primitive, if
            * it is we die which is the expected behavior.
            */
            if ( value == null ) {
                field.setObject( toObject, null );
                continue;
            }

            /* if the value's type and the field type are the same or
            the field just takes an object, then inject what we have as is.
             */
            if ( value.getClass() == field.type() || field.type() == Object.class) {
                field.setValue(toObject, value);
            } else if ( Typ.isBasicType(value) ) {

                field.setValue(toObject, value);
            }


            /* See if it is a map<string, object>, and if it is then process it.
             *  REFACTOR:
             *  It looks like we are using some utility classes here that we could have used in
             *  oldMatchAndConvertArgs.
             *  REFACTOR
              * */
            else if ( value instanceof Map ) {
                setFieldValueFromMap(toObject, field, (Map)value);
            } else if ( value instanceof Collection) {
                /*It is a collection so process it that way. */
                processCollectionFromMapUsingFields( toObject, field, ( Collection ) value);
            } else if ( value instanceof Map[] ) {
                /* It is an array of maps so, we need to process it as such. */
                processArrayOfMaps(toObject, field, ( Map<String, Object>[] )value );
            } else {
                /* If we could not determine how to convert it into some field
                object then we just go ahead an inject it using setValue which
                will call Conversion.coerce.
                 */
                field.setValue( toObject, value );
            }

        }

        return toObject;

    }
fromMap converts a map into a java object
@param map map to create the object from.
@param cls class type of new object
@param <T> map to create teh object from.
@return new object of type cls <T>