当JSON里只含有Bean的部分属性時，更新一個已存在Bean，只覆盖該部分的属性.
161822
public void update(String jsonString, Object object) {
		try {
			mapper.readerForUpdating(object).readValue(jsonString);
		} catch (JsonProcessingException e) {
			logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
		} catch (IOException e) {
			logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
		}
	}
58196
@JavaScriptMethod public final JSONObject news() {
        lastNewsTime = System.currentTimeMillis();
        JSONObject r = new JSONObject();
        try {
            r.put("data", data());
        } catch (RuntimeException x) {
            LOG.log(Level.WARNING, "failed to update " + uri, x);
            status = ERROR;
        }
        Object statusJSON = status == 1 ? "done" : status == CANCELED ? "canceled" : status == ERROR ? "error" : status;
        r.put("status", statusJSON);
        if (statusJSON instanceof String) { // somehow completed
            LOG.log(Level.FINE, "finished in news so releasing {0}", boundId);
            release();
        }
        lastNewsTime = System.currentTimeMillis();
        LOG.log(Level.FINER, "news from {0}", uri);
        return r;
    }
142800
private static JSONObject _fromBean( Object bean, JsonConfig jsonConfig ) {
      if( !addInstance( bean ) ){
         try{
            return jsonConfig.getCycleDetectionStrategy()
                  .handleRepeatedReferenceAsObject( bean );
         }catch( JSONException jsone ){
            removeInstance( bean );
            fireErrorEvent( jsone, jsonConfig );
            throw jsone;
         }catch( RuntimeException e ){
            removeInstance( bean );
            JSONException jsone = new JSONException( e );
            fireErrorEvent( jsone, jsonConfig );
            throw jsone;
         }
      }
      fireObjectStartEvent( jsonConfig );

      JsonBeanProcessor processor = jsonConfig.findJsonBeanProcessor( bean.getClass() );
      if( processor != null ){
         JSONObject json = null;
         try{
            json = processor.processBean( bean, jsonConfig );
            if( json == null ){
               json = (JSONObject) jsonConfig.findDefaultValueProcessor( bean.getClass() )
                     .getDefaultValue( bean.getClass() );
               if( json == null ){
                  json = new JSONObject( true );
               }
            }
            removeInstance( bean );
            fireObjectEndEvent( jsonConfig );
         }catch( JSONException jsone ){
            removeInstance( bean );
            fireErrorEvent( jsone, jsonConfig );
            throw jsone;
         }catch( RuntimeException e ){
            removeInstance( bean );
            JSONException jsone = new JSONException( e );
            fireErrorEvent( jsone, jsonConfig );
            throw jsone;
         }
         return json;
      }

      JSONObject jsonObject = defaultBeanProcessing(bean, jsonConfig);
      removeInstance( bean );
      fireObjectEndEvent( jsonConfig );
      return jsonObject;
   }
164180
@Bean
    @ConditionalOnMissingBean(ISerializer.class)
    public ISerializer<Object> autoloadCacheSerializer() {
        ISerializer<Object> res;
        // 推荐优先使用：Hessian
        if (hessianPresent) {
            res = new HessianSerializer();
            log.debug("HessianSerializer auto-configured");
        } else if (kryoPresent) {
            res = new KryoSerializer();
            log.debug("KryoSerializer auto-configured");
        } else {
            res = new JdkSerializer();
            log.debug("JdkSerializer auto-configured");
        }
        return res;
    }
1029327
private Map<String, List<UrlPattern>> toMap(List<UrlPattern> urlPatterns) {
        Map<String, List<UrlPattern>> map = new ConcurrentHashMap<>();
        for (UrlPattern urlPattern : urlPatterns) {
            try {
                URL url = new URL(urlPattern.getUrlPattern());
                String key = urlPrefix(url);
                List<UrlPattern> value = map.get(key);
                if (value == null) {
                    value = new ArrayList<>();
                    map.put(key, value);
                }
                value.add(urlPattern);
            } catch (Exception e) {
                LOGGER.error("URL规则初始化失败：" + urlPattern.getUrlPattern(), e);
            }
        }
        return map;
    }
1038140
public JSONObject processBean( Object bean, JsonConfig jsonConfig ) {
      JSONObject jsonObject = null;
      if( bean instanceof java.sql.Date ){
         bean = new Date( ((java.sql.Date) bean).getTime() );
      }
      if( bean instanceof Date ){
         Calendar c = Calendar.getInstance();
         c.setTime( (Date) bean );
         jsonObject = new JSONObject().element( "year", c.get( Calendar.YEAR ) )
               .element( "month", c.get( Calendar.MONTH ) )
               .element( "day", c.get( Calendar.DAY_OF_MONTH ) )
               .element( "hours", c.get( Calendar.HOUR_OF_DAY ) )
               .element( "minutes", c.get( Calendar.MINUTE ) )
               .element( "seconds", c.get( Calendar.SECOND ) )
               .element( "milliseconds", c.get( Calendar.MILLISECOND ) );
      }else{
         jsonObject = new JSONObject( true );
      }
      return jsonObject;
   }
613957
@Override
	public JSONObject put(String key, Object value) throws JSONException {
		if (null == key) {
			return this;
		}

		final boolean ignoreNullValue = this.config.isIgnoreNullValue();
		if (ObjectUtil.isNull(value) && ignoreNullValue) {
			// 忽略值模式下如果值为空清除key
			this.remove(key);
		} else {
			InternalJSONUtil.testValidity(value);
			this.rawHashMap.put(key, JSONUtil.wrap(value, ignoreNullValue));
		}
		return this;
	}
1016636
@SneakyThrows
    private void processExcelCellAnnotation(Field field, Object bean) {
        val ann = field.getAnnotation(ExcelCell.class);
        if (ann == null) return;

        Object fv = Fields.invokeField(field, bean);

        if (ann.sheetName()) {
            if (StringUtils.isNotEmpty(ann.replace())) { // 有内容需要替换
                fv = sheet.getSheetName().replace(ann.replace(), Str.nullThen(fv, ""));
            }

            val wb = sheet.getWorkbook();
            val oldSheetName = sheet.getSheetName();
            val newSheetName = "" + fv;
            wb.setSheetName(wb.getSheetIndex(sheet), newSheetName);

            PoiUtil.fixChartSheetNameRef(sheet, oldSheetName, newSheetName);
        } else {
            val cell = PoiUtil.findCell(sheet, ann.value(), StringUtils.defaultIfEmpty(ann.searchKey(), "{" + field.getName() + "}"));
            if (cell == null) {
                log.warn("unable to find cell for {} in field {}", ann, field);
                return;
            }

            if (StringUtils.isNotEmpty(ann.replace())) { // 有内容需要替换
                val old = PoiUtil.getCellStringValue(cell);
                fv = old.replace(ann.replace(), Str.nullThen(fv, ""));
            }

            applyTemplateCellStyle(field, bean, ann, cell);

            val strCellValue = PoiUtil.writeCellValue(cell, fv);
            fixMaxRowHeightRatio(cell.getRow(), ann.maxLineLen(), strCellValue);
        }
    }
140901
private String patchedJsonBody(WebSocketContext context) {
        String body = context.stringMessage();
        if (S.blank(body) || 1 < fieldsAndParamsCount) {
            return body;
        }
        String theName = singleJsonFieldName(context);
        int theNameLen = theName.length();
        if (null == theName) {
            return body;
        }
        body = body.trim();
        boolean needPatch = body.charAt(0) == '[';
        if (!needPatch) {
            if (body.charAt(0) != '{') {
                throw new IllegalArgumentException("Cannot parse JSON string: " + body);
            }
            boolean startCheckName = false;
            int nameStart = -1;
            for (int i = 1; i < body.length(); ++i) {
                char c = body.charAt(i);
                if (c == ' ') {
                    continue;
                }
                if (startCheckName) {
                    if (c == '"') {
                        break;
                    }
                    int id = i - nameStart - 1;
                    if (id >= theNameLen || theName.charAt(i - nameStart - 1) != c) {
                        needPatch = true;
                        break;
                    }
                } else if (c == '"') {
                    startCheckName = true;
                    nameStart = i;
                }
            }
        }
        return needPatch ? S.fmt("{\"%s\": %s}", theName, body) : body;
    }
618801
private void populateMap(Object bean) {
		final Collection<PropDesc> props = BeanUtil.getBeanDesc(bean.getClass()).getProps();

		Method getter;
		Object value;
		for (PropDesc prop : props) {
			// 得到property对应的getter方法
			getter = prop.getGetter();
			if (null == getter) {
				// 无Getter跳过
				continue;
			}

			// 只读取有getter方法的属性
			try {
				value = getter.invoke(bean);
			} catch (Exception ignore) {
				// 忽略读取失败的属性
				continue;
			}

			if (ObjectUtil.isNull(value) && this.config.isIgnoreNullValue()) {
				// 值为null且用户定义跳过则跳过
				continue;
			}

			if (value != bean) {
				// 防止循环引用
				this.rawHashMap.put(prop.getFieldName(), JSONUtil.wrap(value, this.config.isIgnoreNullValue()));
			}
		}
	}
915638
@Override
    protected final void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        if (!support.isLegal(request)) {
            return;
        }
        //设置响应编码格式
        response.setCharacterEncoding("UTF-8");
        String resp = support.processRequest(request);
        PrintWriter pw = response.getWriter();
        pw.write(resp);
        pw.flush();
        pw.close();
    }
1246045
function serializeAllDates(model, json) {
	_.each(json, function (value, name) {
		if ( _.isDate( value ) ) {
			json[ name ] = model.serializeDate( name, value );
		} else if ( !isScalar( value ) && !isBackboneInstance( value ) && isRecursive( value ) ) {
			serializeAllDates( model, value );
		}
	});

	return json;
}
1243682
function(col,row){
		if(col===(void 0)||isNaN(col)){ col=this.cols; row=this.rows;}

		this.allclear(false); // initGroupで、新Objectに対しては別途allclearが呼ばれます

		this.initGroup('cell',   col, row);
		this.initGroup('cross',  col, row);
		this.initGroup('border', col, row);
		this.initGroup('excell', col, row);

		this.cols = col;
		this.rows = row;
		this.setminmax();
		this.setposAll();

		this.initExtraObject(col,row);

		this.rebuildInfo();

		this.puzzle.cursor.initCursor();
		this.puzzle.opemgr.allerase();
	}
792280
function serialize(object) {
	function replacer(key, value) {
		if (typeof value === 'string' && value.match(ISO8601_DATE_REGEX)) {
			value = new Date(value);
			value = value.toISOString();
		}
		return value;
	}

	return JSON.stringify(object, replacer);
}
620806
@Override
    void update(JSONObject pJSONObject, MBeanInfo pMBeanInfo, Stack<String> pPathStack) {
        verifyThatPathIsEmpty(pPathStack);
        pJSONObject.put(getKey(), pMBeanInfo.getClassName());
    }
323972
def NewFromJSON(data):
        
        s = Shake(
            id=data.get('id', None),
            name=data.get('name', None),
            url=data.get('url', None),
            thumbnail_url=data.get('thumbnail_url', None),
            description=data.get('description', None),
            type=data.get('type', None),
            created_at=data.get('created_at', None),
            updated_at=data.get('updated_at', None)
        )
        if data.get('owner', None):
            s.owner = User.NewFromJSON(data.get('owner', None))
        return s
971711
private void registerJsonProxyBean(DefaultListableBeanFactory defaultListableBeanFactory, String className, String path) {
		BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder
				.rootBeanDefinition(JsonProxyFactoryBean.class)
				.addPropertyValue("serviceUrl", appendBasePath(path))
				.addPropertyValue("serviceInterface", className);
		
		if (objectMapper != null) {
			beanDefinitionBuilder.addPropertyValue("objectMapper", objectMapper);
		}
		
		if (contentType != null) {
			beanDefinitionBuilder.addPropertyValue("contentType", contentType);
		}
		
		defaultListableBeanFactory.registerBeanDefinition(className + "-clientProxy", beanDefinitionBuilder.getBeanDefinition());
	}