Java Code Examples for com.fasterxml.jackson.databind.util.ClassUtil#isProxyType()

The following examples show how to use com.fasterxml.jackson.databind.util.ClassUtil#isProxyType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeanDeserializerFactory.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Helper method used to skip processing for types that we know
 * cannot 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("Cannot deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");
    }
    if (ClassUtil.isProxyType(type)) {
        throw new IllegalArgumentException("Cannot deserialize Proxy class "+type.getName()+" as a Bean");
    }
    /* also: can't deserialize some local classes: static are ok; in-method not;
     * other non-static inner classes are ok
     */
    typeStr = ClassUtil.isLocalType(type, true);
    if (typeStr != null) {
        throw new IllegalArgumentException("Cannot deserialize Class "+type.getName()+" (of type "+typeStr+") as a Bean");
    }
    return true;
}
 
Example 2
Source File: BeanSerializerFactory.java    From bistoury with GNU General Public License v3.0 2 votes vote down vote up
/**
 * 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);
}
 
Example 3
Source File: BeanSerializerFactory.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Helper method used to skip processing for types that we know
 * cannot 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);
}