public Application deserialize()

in eureka-client/src/main/java/com/netflix/discovery/converters/EurekaJacksonCodec.java [733:770]


        public Application deserialize(JsonParser jp, DeserializationContext context) throws IOException {
            if (Thread.currentThread().isInterrupted()) {
                throw new JsonParseException(jp, "processing aborted");
            }
            Application application = new Application();
            JsonToken jsonToken;
            try {
                while((jsonToken = jp.nextToken()) != JsonToken.END_OBJECT){
                    if(JsonToken.FIELD_NAME == jsonToken){
                        ApplicationField field = ApplicationField.lookup.find(jp);
                        jsonToken = jp.nextToken();
                        if (field != null) {
                            switch(field) {
                            case NAME:
                                application.setName(jp.getText());
                                break;
                            case INSTANCE:
                                ObjectReader instanceInfoReader = DeserializerStringCache.init(mapper.readerFor(InstanceInfo.class), context);
                                if (jsonToken == JsonToken.START_ARRAY) {
                                    // messages is array, loop until token equal to "]"
                                    while (jp.nextToken() != JsonToken.END_ARRAY) {
                                        application.addInstance(instanceInfoReader.readValue(jp));
                                    }
                                }
                                else if (jsonToken == JsonToken.START_OBJECT) {
                                    application.addInstance(instanceInfoReader.readValue(jp));
                                }
                                break;
                            }
                         }
                    }
                }
            }
            finally {
//                DeserializerStringCache.clear(context, CacheScope.APPLICATION_SCOPE);
            }
            return application;
        }