本文整理匯總了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;
}