Examples of JsonParseException


Examples of com.fasterxml.jackson.core.JsonParseException

    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName = parserWrapper.getCurrentName();

    if ( !PROPERTY_SUB_TYPE.equals( currentName ) ) {
      throw new JsonParseException( "Invalid field. Expected <" + PROPERTY_SUB_TYPE + "> but was <" + currentName + ">", parserWrapper.getCurrentLocation() );
    }
    parserWrapper.nextToken();
    String type = deserializeFrom.getText();

    if ( type == null ) {
      throw new JsonParseException( "Attribute" + PROPERTY_SUB_TYPE + " not found. Cannot find strategy.", deserializeFrom.getCurrentLocation() );
    }

    SerializingStrategy<? extends T, JsonGenerator, JsonParser, JsonProcessingException> strategy = serializingStrategySupport.findStrategy( type );
    Version resolvedVersion = serializingStrategySupport.resolveVersion( strategy, formatVersion );
    return strategy.deserialize( deserializeFrom, resolvedVersion );
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonParseException

      T deserialized = deserializeInternal( parser, version );

      JacksonParserWrapper parserWrapper = new JacksonParserWrapper( parser );
      if ( parserWrapper.nextToken() != null ) {
        throw new JsonParseException( "No consumed everything " + parserWrapper.getCurrentToken(), parserWrapper.getCurrentLocation() );
      }

      parserWrapper.close();
      return deserialized;
    } catch ( InvalidTypeException e ) {
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonParseException

    T deserialized = deserialize( parser, version );

    if ( isObjectType() ) {
      if ( parserWrapper.getCurrentToken() != JsonToken.END_OBJECT ) {
        throw new JsonParseException( "No consumed everything " + parserWrapper.getCurrentToken(), parserWrapper.getCurrentLocation() );
      }
    }

    return deserialized;
  }
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonParseException

      parserWrapper.nextToken();
      parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
      String currentName = parserWrapper.getCurrentName();

      if ( !propertyName.equals( currentName ) ) {
        throw new JsonParseException( "Invalid field. Expected <" + propertyName + "> but was <" + currentName + ">", parserWrapper.getCurrentLocation() );
      }
      parserWrapper.nextToken();
    }

    List<T> deserialized = new ArrayList<T>();
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonParseException

    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName = parserWrapper.getCurrentName();

    if ( !propertyName.equals( currentName ) ) {
      throw new JsonParseException( "Invalid field. Expected <" + propertyName + "> but was <" + currentName + ">", parserWrapper.getCurrentLocation() );
    }
    parserWrapper.nextToken();
    return deserialize( type, formatVersion, deserializeFrom );
  }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonParseException

    public JsonElement get() {
        // the remaining element on the stack is the fully parsed
        // JsonElement
        if(stack.size() == 0) {
            // happens when parsing empty string or just whitespace
            throw new JsonParseException("no elements parsed");
        }
        return stack.getLast();
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonParseException

                return parseContent(parser);
            } finally {
                parser.close();
            }
        } catch (com.fasterxml.jackson.core.JsonParseException e) {
            throw new JsonParseException(e);
        } catch (IOException e) {
            throw new JsonParseException(e);
        }
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonParseException

    public JsonElement parse(final Reader r) throws IOException {
        com.fasterxml.jackson.core.JsonParser parser = jsonFactory.createParser(r);
        try {
            return parseContent(parser);
        } catch(com.fasterxml.jackson.core.JsonParseException e) {
            throw new JsonParseException(e);
        } finally {
            parser.close();
        }
    }
View Full Code Here

Examples of com.google.gson.JsonParseException

    }

    @Override
    public Date deserialize (JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException {
        if (!(json instanceof JsonPrimitive)) {
            throw new JsonParseException("Date was not string: " + json);
        }
        if (type != Date.class) {
            throw new IllegalArgumentException(getClass() + " cannot deserialize to " + type);
        }
        String value = json.getAsString();
View Full Code Here

Examples of com.google.gson.JsonParseException

                    if (kind != null) {
                        return kind;
                    }
                }
            }
            throw new JsonParseException(MessageFormat.format(
                    "Invalid JobStatus.Kind: {0}",
                    json));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.