@@ -0,0 +1,2114 @@
+/*%0A * Copyright 2002-2016 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage playground;%0A%0Aimport com.fasterxml.jackson.annotation.JsonView;%0A%0Aimport org.springframework.web.bind.annotation.GetMapping;%0Aimport org.springframework.web.bind.annotation.RestController;%0A%0A/**%0A * @author Sebastien Deleuze%0A */%0A@RestController%0Apublic class JsonViewController %7B%0A%0A%09@GetMapping(path = %22/jackson/view%22)%0A%09@JsonView(MyJacksonView1.class)%0A%09public JacksonViewBean view() %7B%0A%09%09JacksonViewBean bean = new JacksonViewBean();%0A%09%09bean.setWithView1(%22with%22);%0A%09%09bean.setWithView2(%22with%22);%0A%09%09bean.setWithoutView(%22without%22);%0A%09%09return bean;%0A%09%7D%0A%0A%09@GetMapping(path = %22/jackson/full%22)%0A%09public JacksonViewBean full() %7B%0A%09%09JacksonViewBean bean = new JacksonViewBean();%0A%09%09bean.setWithView1(%22with%22);%0A%09%09bean.setWithView2(%22with%22);%0A%09%09bean.setWithoutView(%22without%22);%0A%09%09return bean;%0A%09%7D%0A%0A%0A%09private interface MyJacksonView1 %7B%7D%0A%0A%09private interface MyJacksonView2 %7B%7D%0A%0A%09private static class JacksonViewBean %7B%0A%0A%09%09@JsonView(MyJacksonView1.class)%0A%09%09private String withView1;%0A%0A%09%09@JsonView(MyJacksonView2.class)%0A%09%09private String withView2;%0A%0A%09%09private String withoutView;%0A%0A%09%09public String getWithView1() %7B%0A%09%09%09return withView1;%0A%09%09%7D%0A%0A%09%09public void setWithView1(String withView1) %7B%0A%09%09%09this.withView1 = withView1;%0A%09%09%7D%0A%0A%09%09public String getWithView2() %7B%0A%09%09%09return withView2;%0A%09%09%7D%0A%0A%09%09public void setWithView2(String withView2) %7B%0A%09%09%09this.withView2 = withView2;%0A%09%09%7D%0A%0A%09%09public String getWithoutView() %7B%0A%09%09%09return withoutView;%0A%09%09%7D%0A%0A%09%09public void setWithoutView(String withoutView) %7B%0A%09%09%09this.withoutView = withoutView;%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Add JsonViewController