当前位置: 首页>>代码示例>>Java>>正文


Java ClassUtil.canBeABeanType方法代码示例

本文整理汇总了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;
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:27,代码来源:BeanDeserializerFactory.java

示例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;
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:13,代码来源:BeanDeserializerFactory.java

示例3: isPotentialBeanType

import com.fasterxml.jackson.databind.util.ClassUtil; //导入方法依赖的package包/类
protected boolean isPotentialBeanType(Class<?> paramClass)
{
  return (ClassUtil.canBeABeanType(paramClass) == null) && (!ClassUtil.isProxyType(paramClass));
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:5,代码来源:BeanSerializerFactory.java

示例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);
}
 
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:13,代码来源:BeanSerializerFactory.java


注:本文中的com.fasterxml.jackson.databind.util.ClassUtil.canBeABeanType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。