Package org.codehaus.jackson.map

Examples of org.codehaus.jackson.map.JsonMappingException$Reference


    }

    protected void _reportSelfReference(Object bean)
        throws JsonMappingException
    {
        throw new JsonMappingException("Direct self-reference leading to cycle");
    }
View Full Code Here


            if (origMsg != null) {
                msg.append(", problem: ").append(origMsg);
            } else {
                msg.append(" (no error message provided)");
            }
            throw new JsonMappingException(msg.toString(), null, e);
        }
        if (e instanceof IOException) {
            throw (IOException) e;
        }
        if (e instanceof RuntimeException) {
            throw (RuntimeException) e;
        }
        // let's wrap the innermost problem
        Throwable t = e;
        while (t.getCause() != null) {
            t = t.getCause();
        }
        throw new JsonMappingException(t.getMessage(), null, t);
    }
View Full Code Here

    }

    protected void _reportSelfReference(Object bean)
        throws JsonMappingException
    {
        throw new JsonMappingException("Direct self-reference leading to cycle");
    }
View Full Code Here

            if (origMsg != null) {
                msg.append(", problem: ").append(origMsg);
            } else {
                msg.append(" (no error message provided)");
            }
            throw new JsonMappingException(msg.toString(), null, e);
        }
        if (e instanceof IOException) {
            throw (IOException) e;
        }
        if (e instanceof RuntimeException) {
            throw (RuntimeException) e;
        }
        // let's wrap the innermost problem
        Throwable t = e;
        while (t.getCause() != null) {
            t = t.getCause();
        }
        throw new JsonMappingException(t.getMessage(), null, t);
    }
View Full Code Here

    {
        Object boundObject = jp.readValueAs(valueClass);
        try {
            return this.xmlAdapter.unmarshal(boundObject);
        } catch (Exception e) {
            throw new JsonMappingException("Unable to unmarshal.", e);
        }
    }
View Full Code Here

  public JsonWrapper(String content) throws Exception {
    this.content = content;
    try {
      target = new MappingJsonFactory().createJsonParser(content.replace("\\","/")).readValueAs(Map.class);
    } catch (JsonParseException e) {
      throw new JsonMappingException("Cannot create wrapper for:\n"+content, e);
    }
    context = new StandardEvaluationContext();
    context.addPropertyAccessor(new MapAccessor());
    parser = new SpelExpressionParser();
  }
View Full Code Here

                    Method m = klass.getMethod(methodName, Multimap.class);
                    return (Multimap<?, ?>) m.invoke(null, map);
                }
                catch (SecurityException e)
                {
                    throw new JsonMappingException("Could not map to " + klass, e);
                }
                catch (NoSuchMethodException e) { }
                catch (IllegalAccessException e) { }
                catch (InvocationTargetException e)
                {
                    throw new JsonMappingException("Could not map to " + klass, e);
                }
            }
        }

        // If everything goes wrong, just give them the LinkedListMultimap...
View Full Code Here

    private void expect(JsonParser jp, JsonToken token) throws IOException
    {
        if (jp.getCurrentToken() != token)
        {
            throw new JsonMappingException("Expecting " + token + ", found " + jp.getCurrentToken(), jp.getCurrentLocation());
        }
    }
View Full Code Here

                JavaType valueType = mapper.getTypeFactory().
                        constructType(new TypeReference<Map<String,PropertyValue<?>>>() { }.getType());
                DeserializerProvider provider = ctxt.getDeserializerProvider();
                JsonDeserializer<?> deser = provider.findTypedValueDeserializer(ctxt.getConfig(), valueType, null);
                if (deser == null) { // can this happen?
                    throw new JsonMappingException("Can not find a deserializer for type "+ valueType);
                }

                @SuppressWarnings({"unchecked"})
                Map<String, PropertyValue<?>> map = (Map<String, PropertyValue<?>>)deser.deserialize(jp, ctxt);
               
                return new NestedProperties(map);
            }
            case START_ARRAY:
            {
                JavaType valueType = mapper.getTypeFactory().
                        constructType(new TypeReference<List<String>>() { }.getType());
                DeserializerProvider provider = ctxt.getDeserializerProvider();
                JsonDeserializer<?> deser = provider.findTypedValueDeserializer(ctxt.getConfig(), valueType, null);
                if (deser == null) { // can this happen?
                    throw new JsonMappingException("Can not find a deserializer for type "+ valueType);
                }

                @SuppressWarnings({"unchecked"})
                List<String> list = (List<String>)deser.deserialize(jp, ctxt);
               
View Full Code Here

        BucketPropertiesBuilder builder = new BucketPropertiesBuilder();
        JsonNode props = root.path(Constants.FL_SCHEMA);

        if (props.isMissingNode()) {
            throw new JsonMappingException("no 'props' field found");
        }

        builder.allowSiblings(props.path(Constants.FL_SCHEMA_ALLOW_MULT).getBooleanValue());
        builder.lastWriteWins(props.path(Constants.FL_SCHEMA_LAST_WRITE_WINS).getBooleanValue());
        builder.nVal(props.path(Constants.FL_SCHEMA_NVAL).getIntValue());
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.map.JsonMappingException$Reference

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.