@Test(expected=IllegalArgumentException.class) public void shouldNotAcceptMethodsWithoutArguments() throws Exception { deserializer.deserialize(new ByteArrayInputStream(new byte[0]), meow); }
public Object[] deserialize(InputStream inputStream, ResourceMethod method) { Method javaMethod = method.getMethod(); Class<?>[] types = javaMethod.getParameterTypes(); checkArgument(types.length > 0, "Methods that consumes representations must receive just one argument: the root element"); XStream xStream = getConfiguredXStream(javaMethod, types); Object[] params = new Object[types.length]; chooseParam(types, params, xStream.fromXML(inputStream)); return params; }
JsonDeserializer implements Deserializer { public Object[] deserialize(InputStream inputStream, ResourceMethod method) { Method javaMethod = method.getMethod(); Class<?>[] types = javaMethod.getParameterTypes(); checkArgument(types.length > 0, "Methods that consumes representations must receive just one argument: the root element"); XStream xStream = getConfiguredXStream(javaMethod, types); Object[] params = new Object[types.length]; chooseParam(types, params, xStream.fromXML(inputStream)); return params; } }
JsonDeserializer implements Deserializer { public Object[] deserialize(InputStream inputStream, ResourceMethod method) { Method javaMethod = method.getMethod(); Class<?>[] types = javaMethod.getParameterTypes(); checkArgument(types.length > 0, "Methods that consumes representations must receive just one argument: the root element"); XStream xStream = getConfiguredXStream(javaMethod, types); Object[] params = new Object[types.length]; chooseParam(types, params, xStream.fromXML(inputStream)); return params; } JsonDeserializer(ParameterNameProvider provider,TypeNameExtractor extractor, XStreamBuilder builder); }
JsonDeserializer implements Deserializer { public Object[] deserialize(InputStream inputStream, ResourceMethod method) { Method javaMethod = method.getMethod(); Class<?>[] types = javaMethod.getParameterTypes(); checkArgument(types.length > 0, "Methods that consumes representations must receive just one argument: the root element"); XStream xStream = getConfiguredXStream(javaMethod, types); Object[] params = new Object[types.length]; chooseParam(types, params, xStream.fromXML(inputStream)); return params; } JsonDeserializer(ParameterNameProvider provider,TypeNameExtractor extractor, XStreamBuilder builder); Object[] deserialize(InputStream inputStream, ResourceMethod method); XStream getConfiguredXStream(Method javaMethod, Class<?>[] types); }
JsonDeserializer implements Deserializer { public Object[] deserialize(InputStream inputStream, ResourceMethod method) { Method javaMethod = method.getMethod(); Class<?>[] types = javaMethod.getParameterTypes(); checkArgument(types.length > 0, "Methods that consumes representations must receive just one argument: the root element"); XStream xStream = getConfiguredXStream(javaMethod, types); Object[] params = new Object[types.length]; chooseParam(types, params, xStream.fromXML(inputStream)); return params; } JsonDeserializer(ParameterNameProvider provider,TypeNameExtractor extractor, XStreamBuilder builder); Object[] deserialize(InputStream inputStream, ResourceMethod method); XStream getConfiguredXStream(Method javaMethod, Class<?>[] types);  }