Fastjson gets the unknown field

  java

maven

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.7</version>
        </dependency>
        <dependency>
             <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>

Get unknown field

        JSONObject jsonObj = JSON.parseObject(json);
        List<Field> fields = FieldUtils.getAllFieldsList(Demo.class);
        fields.stream().forEach(e -> {
            jsonObj.remove(e.getName());
        });
        System.out.println(jsonObj);