Examples of JsonToken


Examples of com.fasterxml.jackson.core.JsonToken

       
        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.currentToken;
        if (token == null) token = context.nextToken();
        if (token == VALUE_NULL) return null;

        while (true) {
            if (token == null) break;
View Full Code Here

Examples of com.fasterxml.jackson.core.JsonToken

        }

        @Override
        public StackTraceElement deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException,
                JsonProcessingException {
            JsonToken t = jp.getCurrentToken();
            // Must get an Object
            if (t == JsonToken.START_OBJECT) {
                String className = Strings.EMPTY, methodName = Strings.EMPTY, fileName = Strings.EMPTY;
                int lineNumber = -1;

                while ((t = jp.nextValue()) != JsonToken.END_OBJECT) {
                    String propName = jp.getCurrentName();
                    if ("class".equals(propName)) {
                        className = jp.getText();
                    } else if ("file".equals(propName)) {
                        fileName = jp.getText();
                    } else if ("line".equals(propName)) {
                        if (t.isNumeric()) {
                            lineNumber = jp.getIntValue();
                        } else {
                            throw JsonMappingException.from(jp, "Non-numeric token (" + t
                                    + ") for property 'lineNumber'");
                        }
View Full Code Here

Examples of com.github.nmorel.gwtjackson.client.stream.JsonToken

        // Processing the parameters. We fallback to default if parameter is not present.
        final IdentityDeserializationInfo identityInfo = null == params.getIdentityInfo() ? defaultIdentityInfo : params.getIdentityInfo();
        final TypeDeserializationInfo typeInfo = null == params.getTypeInfo() ? defaultTypeInfo : params.getTypeInfo();

        JsonToken token = reader.peek();

        // If it's not a json object or array, it must be an identifier
        if ( null != identityInfo && !JsonToken.BEGIN_OBJECT.equals( token ) && !JsonToken.BEGIN_ARRAY.equals( token ) ) {
            Object id;
            if ( identityInfo.isProperty() ) {
View Full Code Here

Examples of com.google.api.client.json.JsonToken

          && HttpMediaType.equalsIgnoreParameters(Json.MEDIA_TYPE, response.getContentType())
          && response.getContent() != null) {
        JsonParser parser = null;
        try {
          parser = jsonFactory.createJsonParser(response.getContent());
          JsonToken currentToken = parser.getCurrentToken();
          // token is null at start, so get next token
          if (currentToken == null) {
            currentToken = parser.nextToken();
          }
          // check for empty content
View Full Code Here

Examples of com.google.api.client.json.JsonToken

          break;
        }
      }
      // parse each public key in the JSON response
      JsonParser parser = jsonFactory.createJsonParser(certsResponse.getContent());
      JsonToken currentToken = parser.getCurrentToken();
      // token is null at start, so get next token
      if (currentToken == null) {
        currentToken = parser.nextToken();
      }
      Preconditions.checkArgument(currentToken == JsonToken.START_OBJECT);
View Full Code Here

Examples of com.google.gson.stream.JsonToken

  protected void readData(JsonReaderExt jsonParser) throws IOException {
   
    jsonParser.consumeExpected(JsonToken.BEGIN_OBJECT);
   
    while(jsonParser.hasNext()) {
      JsonToken tokenType = jsonParser.peek();
     
      if(tokenType == JsonToken.NAME) {
        String propertyName = jsonParser.nextName();
       
        if(propertyName.equals("mainPackage")) {
View Full Code Here

Examples of com.google.gson.stream.JsonToken

    jsonParser.consumeExpected(JsonToken.BEGIN_ARRAY);
   
    ArrayList<DubBundle> bundles = new ArrayList<>();
   
    while(jsonParser.hasNext()) {
      JsonToken tokenType = jsonParser.peek();
     
      if(tokenType == JsonToken.BEGIN_OBJECT) {
        DubBundle bundle = new DubManifestParser().readBundle(jsonParser).createBundle(null, false);
        bundles.add(bundle);
      } else {
View Full Code Here

Examples of com.google.gson.stream.JsonToken

 
  protected DubManifestParser readBundle(JsonReaderExt jsonReader) throws IOException {
    jsonReader.consumeExpected(JsonToken.BEGIN_OBJECT);
   
    while(jsonReader.hasNext()) {
      JsonToken tokenType = jsonReader.peek();
     
      if(tokenType == JsonToken.NAME) {
        String propertyName = jsonReader.nextName();
       
        if(propertyName.equals("name")) {
View Full Code Here

Examples of com.google.gson.stream.JsonToken

                jsonReader.beginArray();
                // The Gson parser is a little unintuitive here. Nested objects,
                // have their own relative notion of hasNext; when hasNext()
                // is done, it is only for this array.
                while (jsonReader.hasNext()) {
                    JsonToken jsonToken2 = jsonReader.peek();
                    if (jsonToken2 == JsonToken.STRING) {
                        values.add(jsonReader.nextString());
                    }
                }
                jsonReader.endArray();
View Full Code Here

Examples of com.google.gson.stream.JsonToken

    NavigationPropertyInfo navigationPropertyInfo = eia.getNavigationPropertyInfo(navigationPropertyName);
    if (navigationPropertyInfo == null) {
      throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT.addContent(navigationPropertyName));
    }

    JsonToken peek = reader.peek();
    if (peek == JsonToken.BEGIN_OBJECT) {
      reader.beginObject();
      String name = reader.nextName();
      if (FormatJson.DEFERRED.equals(name)) {
        reader.beginObject();
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.