{"action":"created","issue":{"url":"https://api.github.com/repos/venusdrogon/feilong-core/issues/505","repository_url":"https://api.github.com/repos/venusdrogon/feilong-core","labels_url":"https://api.github.com/repos/venusdrogon/feilong-core/issues/505/labels{/name}","comments_url":"https://api.github.com/repos/venusdrogon/feilong-core/issues/505/comments","events_url":"https://api.github.com/repos/venusdrogon/feilong-core/issues/505/events","html_url":"https://github.com/venusdrogon/feilong-core/issues/505","id":183381041,"number":505,"title":"json format 需要支持修改key的名字","user":{"login":"venusdrogon","id":3479472,"avatar_url":"https://avatars.githubusercontent.com/u/3479472?v=3","gravatar_id":"","url":"https://api.github.com/users/venusdrogon","html_url":"https://github.com/venusdrogon","followers_url":"https://api.github.com/users/venusdrogon/followers","following_url":"https://api.github.com/users/venusdrogon/following{/other_user}","gists_url":"https://api.github.com/users/venusdrogon/gists{/gist_id}","starred_url":"https://api.github.com/users/venusdrogon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/venusdrogon/subscriptions","organizations_url":"https://api.github.com/users/venusdrogon/orgs","repos_url":"https://api.github.com/users/venusdrogon/repos","events_url":"https://api.github.com/users/venusdrogon/events{/privacy}","received_events_url":"https://api.github.com/users/venusdrogon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-17T10:34:36Z","updated_at":"2016-10-21T08:08:26Z","closed_at":null,"body":"json format 需要支持修改key的名字\r\n\r\nminglei  说, 我们的java 属性是标准的属性名字, 比如name\r\n但是和第三方对接的时候, 对方的文档要求是 Name, 首字母需要大写的\r\n\r\n所以需要增加这么一个功能"},"comment":{"url":"https://api.github.com/repos/venusdrogon/feilong-core/issues/comments/255320420","html_url":"https://github.com/venusdrogon/feilong-core/issues/505#issuecomment-255320420","issue_url":"https://api.github.com/repos/venusdrogon/feilong-core/issues/505","id":255320420,"user":{"login":"shade41-code","id":22976778,"avatar_url":"https://avatars.githubusercontent.com/u/22976778?v=3","gravatar_id":"","url":"https://api.github.com/users/shade41-code","html_url":"https://github.com/shade41-code","followers_url":"https://api.github.com/users/shade41-code/followers","following_url":"https://api.github.com/users/shade41-code/following{/other_user}","gists_url":"https://api.github.com/users/shade41-code/gists{/gist_id}","starred_url":"https://api.github.com/users/shade41-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shade41-code/subscriptions","organizations_url":"https://api.github.com/users/shade41-code/orgs","repos_url":"https://api.github.com/users/shade41-code/repos","events_url":"https://api.github.com/users/shade41-code/events{/privacy}","received_events_url":"https://api.github.com/users/shade41-code/received_events","type":"User","site_admin":false},"created_at":"2016-10-21T08:08:26Z","updated_at":"2016-10-21T08:08:26Z","body":"       JsonConfig jsonConfig = new JsonConfig();\r\n\r\n        for (Class<?> class1 : classList){\r\n            PropertyNameProcessor propertyNameProcessor = new PropertyNameProcessor(){\r\n                @Override\r\n                public String processPropertyName(Class target,String fieldName){\r\n                    return fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);\r\n                }\r\n            };\r\n            jsonConfig.registerJsonPropertyNameProcessor(class1, propertyNameProcessor);\r\n        }\r\n\r\n        PropertyFilter propertyFilter = new PropertyFilter(){\r\n            @Override\r\n            public boolean apply(Object arg0,String arg1,Object arg2){\r\n                return Validator.isNullOrEmpty(arg2);\r\n            }\r\n        };\r\n\r\n        jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);\r\n        jsonConfig.setIgnoreDefaultExcludes(false);\r\n        jsonConfig.registerJsonValueProcessor(Date.class, new DateJsonValueProcessor(DatePattern.COMMON_DATE_AND_TIME));\r\n        jsonConfig.setAllowNonStringKeys(true);\r\n        jsonConfig.setJsonPropertyFilter(propertyFilter);\r\n\r\n        JSONObject.fromObject(obj, jsonConfig);\r\n\r\n这段代码就可以将传入的对象每个属性首字母大写，而且属性值为空的属性不进行序列化\r\n\r\n"}}
{"actor":{"display_login":"shade41-code"}}