本文整理汇总了Java中org.restlet.ext.jackson.JacksonRepresentation.getObject方法的典型用法代码示例。如果您正苦于以下问题:Java JacksonRepresentation.getObject方法的具体用法?Java JacksonRepresentation.getObject怎么用?Java JacksonRepresentation.getObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.restlet.ext.jackson.JacksonRepresentation
的用法示例。
在下文中一共展示了JacksonRepresentation.getObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postData
import org.restlet.ext.jackson.JacksonRepresentation; //导入方法依赖的package包/类
@Post
public Representation postData(Representation jsonRep) throws IOException {
JacksonRepresentation<Score> inputRep = new JacksonRepresentation<Score>(jsonRep, Score.class);
Score score = inputRep.getObject();
return new JacksonRepresentation<Score>(MySQL.setRoom(score));
}
示例2: update
import org.restlet.ext.jackson.JacksonRepresentation; //导入方法依赖的package包/类
@Put("json")
public void update(Representation representation) throws IOException {
JacksonRepresentation<Todo> jsonRepresentation = new JacksonRepresentation<Todo>(representation, Todo.class);
Todo todo = jsonRepresentation.getObject();
repository.update(todo);
}
示例3: create
import org.restlet.ext.jackson.JacksonRepresentation; //导入方法依赖的package包/类
@Post("json")
public void create(Representation representation) throws IOException {
JacksonRepresentation<Todo> jsonRepresentation = new JacksonRepresentation<Todo>(representation, Todo.class);
Todo todo = jsonRepresentation.getObject();
repository.create(todo);
}