return Movie.class.isAssignableFrom(type);
}
@Override
public Movie readFrom(Class<Movie> type, Type type1, Annotation[] antns, MediaType mt, MultivaluedMap<String, String> mm, InputStream in) throws IOException, WebApplicationException {
Movie movie = new Movie();
JsonParser parser = Json.createParser(in);
while (parser.hasNext()) {
switch (parser.next()) {
case KEY_NAME:
String key = parser.getString();
parser.next();
switch (key) {
case "id":
movie.setId(parser.getInt());
break;
case "name":
movie.setName(parser.getString());
break;
case "actors":
movie.setActors(parser.getString());
break;
default:
break;
}
break;