private IEntityRandomAccess getCSONElementFromObject(Object value,IEntityRandomAccess target){
        IEntityRandomAccess targetElement = null;
        try {
            if (target != null){
                targetElement  = target;
            }else{
                targetElement = new CSONComplexElement(EntitySchemaCache.objectSchemaFactory(value.getClass()),null);
            }
            IEntitySchema schema = targetElement.getSchema();
            Method[] fiGetList = EntitySchemaCache.getFiGetCache(schema.entityId());
            for (int i = 0;i < schema.count();i++) {
                Object propertyValue = fiGetList[i].invoke(value);
                if (propertyValue == null) {
                    targetElement.setValue(i, CSONElement.NullValue);
                }else{
                    IElementType type = schema.getElementType(i);
                    Object object = null;
                    if (type instanceof  CSONSimpleType){
                        object = propertyValue;
                    }else if(type instanceof CSONComplexType){
                        object = getCSONElementFromObject(propertyValue,null);
                    } else if(type instanceof  CSONArrayType){
                        CSONSimpleType childElementType = ((CSONArrayType)schema.getElementType(i)).getElementType();
                        object = getCSONArrayFromObject(propertyValue,childElementType);
                    }
                    targetElement.setValue(i,object);
                }
            }
        }catch (IllegalAccessException e){
            e.printStackTrace();
        }catch (InvocationTargetException e){
            e.printStackTrace();
        }catch (Exception e){
            e.printStackTrace();
        }
        return targetElement;
    }