本文整理汇总了Java中org.codehaus.jackson.map.type.SimpleType类的典型用法代码示例。如果您正苦于以下问题:Java SimpleType类的具体用法?Java SimpleType怎么用?Java SimpleType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimpleType类属于org.codehaus.jackson.map.type包,在下文中一共展示了SimpleType类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jsonRootDeserializerShouldReturnNullForNonJsonRootWrapperType
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
@Test
@RoxableTest(key = "c03c81c0e9eb")
public void jsonRootDeserializerShouldReturnNullForNonJsonRootWrapperType() {
JavaType type = SimpleType.construct(Integer.class);
JsonDeserializer d = null;
try {
d = jsonRootDeserializer.findBeanDeserializer(type, null, null, null, null);
} catch (JsonMappingException ex) {
fail("Unexpected exception when finding Bean Deserializer");
}
assertNull(d);
}
示例2: getProjects
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
public List<Project> getProjects() throws AuthenticationFailedException, ServiceNotFoundException, Exception {
HttpURLConnection con = getServiceConnection("api/projects");
if (con.getResponseCode() == 401) {
throw new AuthenticationFailedException();
} else if (con.getResponseCode() == 404) {
throw new ServiceNotFoundException();
}
JavaType type = CollectionType.construct(ArrayList.class, SimpleType.construct(Project.class));
InputStream in = con.getInputStream();
try {
return (List<Project>) objectMapper.readValue(in, type);
} finally {
in.close();
}
}
示例3: containedType
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
@Override
public JavaType containedType(int index) {
return SimpleType.construct(genericClass);
}
示例4: getValueType
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
@Override
public JavaType getValueType() {
return SimpleType.construct(String.class);
}
示例5: withTypeHandler
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
@Override public JavaType withTypeHandler(Object h) { return SimpleType.construct(h.getClass()); }
示例6: withContentTypeHandler
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
@Override public JavaType withContentTypeHandler(Object h) { return SimpleType.construct(h.getClass()); }
示例7: _narrow
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
@Override protected JavaType _narrow(Class<?> subclass) { return SimpleType.construct(subclass); }
示例8: narrowContentsBy
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
@Override public JavaType narrowContentsBy(Class<?> contentClass) { return SimpleType.construct(contentClass); }
示例9: widenContentsBy
import org.codehaus.jackson.map.type.SimpleType; //导入依赖的package包/类
@Override public JavaType widenContentsBy(Class<?> contentClass) { return SimpleType.construct(contentClass); }