Browse Source

BindingJacsonConverter/View -> MappingJacksonConverter/View

conversation
Arjen Poutsma 16 years ago
parent
commit
6598fd736d
  1. 6
      org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/json/MappingJacksonJsonView.java
  2. 8
      org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/view/json/MappingJacksonJsonViewTest.java
  3. 4
      org.springframework.web/src/main/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.java
  4. 8
      org.springframework.web/src/test/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverterTest.java

6
org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/json/BindingJacksonJsonView.java → org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/json/MappingJacksonJsonView.java

@ -43,10 +43,10 @@ import org.springframework.web.servlet.view.AbstractView; @@ -43,10 +43,10 @@ import org.springframework.web.servlet.view.AbstractView;
*
* @author Jeremy Grelle
* @author Arjen Poutsma
* @see org.springframework.http.converter.json.BindingJacksonHttpMessageConverter
* @see org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
* @since 3.0
*/
public class BindingJacksonJsonView extends AbstractView {
public class MappingJacksonJsonView extends AbstractView {
/**
* Default content type. Overridable as bean property.
@ -64,7 +64,7 @@ public class BindingJacksonJsonView extends AbstractView { @@ -64,7 +64,7 @@ public class BindingJacksonJsonView extends AbstractView {
/**
* Construct a new {@code JacksonJsonView}, setting the content type to {@code application/json}.
*/
public BindingJacksonJsonView() {
public MappingJacksonJsonView() {
setContentType(DEFAULT_CONTENT_TYPE);
}

8
org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/view/json/BindingJacksonJsonViewTest.java → org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/view/json/MappingJacksonJsonViewTest.java

@ -47,9 +47,9 @@ import org.springframework.validation.BindingResult; @@ -47,9 +47,9 @@ import org.springframework.validation.BindingResult;
* @author Jeremy Grelle
* @author Arjen Poutsma
*/
public class BindingJacksonJsonViewTest {
public class MappingJacksonJsonViewTest {
private BindingJacksonJsonView view;
private MappingJacksonJsonView view;
private MockHttpServletRequest request;
@ -67,7 +67,7 @@ public class BindingJacksonJsonViewTest { @@ -67,7 +67,7 @@ public class BindingJacksonJsonViewTest {
jsContext = ContextFactory.getGlobal().enterContext();
jsScope = jsContext.initStandardObjects();
view = new BindingJacksonJsonView();
view = new MappingJacksonJsonView();
}
@Test
@ -79,7 +79,7 @@ public class BindingJacksonJsonViewTest { @@ -79,7 +79,7 @@ public class BindingJacksonJsonViewTest {
view.render(model, request, response);
assertEquals(BindingJacksonJsonView.DEFAULT_CONTENT_TYPE, response.getContentType());
assertEquals(MappingJacksonJsonView.DEFAULT_CONTENT_TYPE, response.getContentType());
String jsonResult = response.getContentAsString();
assertTrue(jsonResult.length() > 0);

4
org.springframework.web/src/main/java/org/springframework/http/converter/json/BindingJacksonHttpMessageConverter.java → org.springframework.web/src/main/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.java

@ -46,7 +46,7 @@ import org.springframework.util.Assert; @@ -46,7 +46,7 @@ import org.springframework.util.Assert;
* @see org.springframework.web.servlet.view.json.BindingJacksonJsonView
* @since 3.0
*/
public class BindingJacksonHttpMessageConverter<T> extends AbstractHttpMessageConverter<T> {
public class MappingJacksonHttpMessageConverter<T> extends AbstractHttpMessageConverter<T> {
private ObjectMapper objectMapper = new ObjectMapper();
@ -57,7 +57,7 @@ public class BindingJacksonHttpMessageConverter<T> extends AbstractHttpMessageCo @@ -57,7 +57,7 @@ public class BindingJacksonHttpMessageConverter<T> extends AbstractHttpMessageCo
/**
* Construct a new {@code BindingJacksonHttpMessageConverter},
*/
public BindingJacksonHttpMessageConverter() {
public MappingJacksonHttpMessageConverter() {
super(new MediaType("application", "json"));
}

8
org.springframework.web/src/test/java/org/springframework/http/converter/json/BindingJacksonHttpMessageConverterTest.java → org.springframework.web/src/test/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverterTest.java

@ -31,13 +31,13 @@ import org.springframework.http.MockHttpInputMessage; @@ -31,13 +31,13 @@ import org.springframework.http.MockHttpInputMessage;
import org.springframework.http.MockHttpOutputMessage;
/** @author Arjen Poutsma */
public class BindingJacksonHttpMessageConverterTest {
public class MappingJacksonHttpMessageConverterTest {
private BindingJacksonHttpMessageConverter<MyBean> converter;
private MappingJacksonHttpMessageConverter<MyBean> converter;
@Before
public void setUp() {
converter = new BindingJacksonHttpMessageConverter<MyBean>();
converter = new MappingJacksonHttpMessageConverter<MyBean>();
}
@Test
@ -63,7 +63,7 @@ public class BindingJacksonHttpMessageConverterTest { @@ -63,7 +63,7 @@ public class BindingJacksonHttpMessageConverterTest {
@Test
@SuppressWarnings({"unchecked"})
public void readUntyped() throws IOException {
BindingJacksonHttpMessageConverter<HashMap> converter = new BindingJacksonHttpMessageConverter<HashMap>();
MappingJacksonHttpMessageConverter<HashMap> converter = new MappingJacksonHttpMessageConverter<HashMap>();
String body =
"{\"bytes\":\"AQI=\",\"array\":[\"Foo\",\"Bar\"],\"number\":42,\"string\":\"Foo\",\"bool\":true,\"fraction\":42.0}";
MockHttpInputMessage inputMessage = new MockHttpInputMessage(body.getBytes("UTF-8"));
Loading…
Cancel
Save