本文整理汇总了Java中org.codehaus.jackson.map.util.Provider类的典型用法代码示例。如果您正苦于以下问题:Java Provider类的具体用法?Java Provider怎么用?Java Provider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Provider类属于org.codehaus.jackson.map.util包,在下文中一共展示了Provider类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findSerializer
import org.codehaus.jackson.map.util.Provider; //导入依赖的package包/类
public JsonSerializer<?> findSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType)
{
Class localClass = paramJavaType.getRawClass();
String str1 = localClass.getName();
String str2;
if (str1.startsWith("org.joda.time."))
str2 = "org.codehaus.jackson.map.ext.JodaSerializers";
Object localObject;
while (true)
{
localObject = instantiate(str2);
if (localObject != null)
break;
return null;
if ((str1.startsWith("javax.xml.")) || (hasSupertypeStartingWith(localClass, "javax.xml.")))
{
str2 = "org.codehaus.jackson.map.ext.CoreXMLSerializers";
continue;
}
if (doesImplement(localClass, "org.w3c.dom.Node"))
return (JsonSerializer)instantiate("org.codehaus.jackson.map.ext.DOMSerializer");
return null;
}
Collection localCollection = ((Provider)localObject).provide();
Iterator localIterator1 = localCollection.iterator();
while (localIterator1.hasNext())
{
Map.Entry localEntry2 = (Map.Entry)localIterator1.next();
if (localClass == localEntry2.getKey())
return (JsonSerializer)localEntry2.getValue();
}
Iterator localIterator2 = localCollection.iterator();
while (localIterator2.hasNext())
{
Map.Entry localEntry1 = (Map.Entry)localIterator2.next();
if (((Class)localEntry1.getKey()).isAssignableFrom(localClass))
return (JsonSerializer)localEntry1.getValue();
}
return null;
}