Package com.fasterxml.jackson.jr.ob

Examples of com.fasterxml.jackson.jr.ob.JSONObjectException


    public Object getValueFor(Object bean) throws IOException
    {
        try {
            return _getMethod.invoke(bean);
        } catch (Exception e) {
            throw new JSONObjectException("Failed to access property '"+_name+"' (type "
                    +_rawType.getName()+"; exception "+e.getClass().getName()+"): "
                    +e.getMessage(), e);
        }
    }
View Full Code Here


    public Object setValueFor(Object bean, Object value) throws IOException
    {
        try {
            return _setMethod.invoke(bean, value);
        } catch (Exception e) {
            throw new JSONObjectException("Failed to set property '"+_name+"' (type "
                    +_rawType.getName()+"; exception "+e.getClass().getName()+"): "
                    +e.getMessage(), e);
        }
    }
View Full Code Here

            throw new IllegalStateException("No getter for property '"+_name+"' (type "+_bean()+")");
        }
        try {
            return _getMethod.invoke(bean);
        } catch (Exception e) {
            throw new JSONObjectException("Failed to access property '"+_name+"'; exception "+e.getClass().getName()+"): "
                    +e.getMessage(), e);
        }
    }
View Full Code Here

        } catch (Exception e) {
            Throwable t = e;
            while (t.getCause() != null) {
                t = t.getCause();
            }
            throw new JSONObjectException("Failed to set property '"+_name+"'; exception "+e.getClass().getName()+"): "
                    +e.getMessage(), e);
        }
    }
View Full Code Here

        writeBooleanArrayValue(v);
    }

    protected void writeTreeNodeValue(TreeNode v) throws IOException {
        if (_treeCodec == null) {
            throw new JSONObjectException("No TreeCodec configured: can not serializer TreeNode values");
        }
        _treeCodec.writeTree(_generator, v);
    }
View Full Code Here

    }

    protected void _checkUnknown(Object value) throws IOException
    {
        if (Feature.FAIL_ON_UNKNOWN_TYPE_WRITE.isEnabled(_features)) {
            throw new JSONObjectException("Unrecognized type ("+value.getClass().getName()
                    +"), don't know how to write (disable "+Feature.FAIL_ON_UNKNOWN_TYPE_WRITE
                    +" to avoid exception)");
        }
    }
View Full Code Here

    @Override
    public <T> Iterator<T> readValues(JsonParser jp, Class<T> valueType)
            throws IOException, JsonProcessingException {
        // May be able to support in future but...
        throw new JSONObjectException("Simple JSON does not support 'readValues()' methods");
    }
View Full Code Here

            throws IOException, JsonProcessingException {
        return (Iterator<T>) readValues(jp, valueType.getRawClass());
    }
   
    protected JSONObjectException _noTypeReference() {
        return new JSONObjectException("Simple JSON does not support use of TypeReference");
    }
View Full Code Here

    protected void _checkResultType(Class<?> valueType, Object ob)
        throws JSONObjectException
    {
        if (ob != null) {
            if (!valueType.isAssignableFrom(ob.getClass())) {
                throw new JSONObjectException("Simple JSON can only bind given JSON as "
                        +ob.getClass().getName()+", not as "+valueType.getName());
            }
        }
    }
View Full Code Here

            throw new IllegalStateException("No getter for property '"+_name+"' (type "+_bean()+")");
        }
        try {
            return _getMethod.invoke(bean);
        } catch (Exception e) {
            throw new JSONObjectException("Failed to access property '"+_name+"'; exception "+e.getClass().getName()+"): "
                    +e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.jr.ob.JSONObjectException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.