本文整理汇总了Java中com.fasterxml.jackson.databind.util.ClassUtil.canBeABeanType方法的典型用法代码示例。如果您正苦于以下问题:Java ClassUtil.canBeABeanType方法的具体用法?Java ClassUtil.canBeABeanType怎么用?Java ClassUtil.canBeABeanType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fasterxml.jackson.databind.util.ClassUtil
的用法示例。
在下文中一共展示了ClassUtil.canBeABeanType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isPotentialBeanType
import com.fasterxml.jackson.databind.util.ClassUtil; //导入方法依赖的package包/类
/**
* Helper method used to skip processing for types that we know
* can not be (i.e. are never consider to be) beans:
* things like primitives, Arrays, Enums, and proxy types.
*<p>
* Note that usually we shouldn't really be getting these sort of
* types anyway; but better safe than sorry.
*/
protected boolean isPotentialBeanType(Class<?> type)
{
String typeStr = ClassUtil.canBeABeanType(type);
if (typeStr != null) {
throw new IllegalArgumentException("Can not deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");
}
if (ClassUtil.isProxyType(type)) {
throw new IllegalArgumentException("Can not deserialize Proxy class "+type.getName()+" as a Bean");
}
/* also: can't deserialize some local classes: static are ok; in-method not;
* and with [JACKSON-594], other non-static inner classes are ok
*/
typeStr = ClassUtil.isLocalType(type, true);
if (typeStr != null) {
throw new IllegalArgumentException("Can not deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");
}
return true;
}
示例2: isPotentialBeanType
import com.fasterxml.jackson.databind.util.ClassUtil; //导入方法依赖的package包/类
protected boolean isPotentialBeanType(Class<?> paramClass)
{
String str1 = ClassUtil.canBeABeanType(paramClass);
if (str1 != null)
throw new IllegalArgumentException("Can not deserialize Class " + paramClass.getName() + " (of type " + str1 + ") as a Bean");
if (ClassUtil.isProxyType(paramClass))
throw new IllegalArgumentException("Can not deserialize Proxy class " + paramClass.getName() + " as a Bean");
String str2 = ClassUtil.isLocalType(paramClass, true);
if (str2 != null)
throw new IllegalArgumentException("Can not deserialize Class " + paramClass.getName() + " (of type " + str2 + ") as a Bean");
return true;
}
示例3: isPotentialBeanType
import com.fasterxml.jackson.databind.util.ClassUtil; //导入方法依赖的package包/类
protected boolean isPotentialBeanType(Class<?> paramClass)
{
return (ClassUtil.canBeABeanType(paramClass) == null) && (!ClassUtil.isProxyType(paramClass));
}
示例4: isPotentialBeanType
import com.fasterxml.jackson.databind.util.ClassUtil; //导入方法依赖的package包/类
/**
* Helper method used to skip processing for types that we know
* can not be (i.e. are never consider to be) beans:
* things like primitives, Arrays, Enums, and proxy types.
*<p>
* Note that usually we shouldn't really be getting these sort of
* types anyway; but better safe than sorry.
*/
protected boolean isPotentialBeanType(Class<?> type)
{
return (ClassUtil.canBeABeanType(type) == null) && !ClassUtil.isProxyType(type);
}