All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.jackson.map.BeanDescription Maven / Gradle / Ivy

There is a newer version: 7.4.3.112-ga112
Show newest version
package org.codehaus.jackson.map;

import java.util.*;

import org.codehaus.jackson.map.introspect.AnnotatedClass;
import org.codehaus.jackson.map.introspect.AnnotatedConstructor;
import org.codehaus.jackson.map.introspect.AnnotatedField;
import org.codehaus.jackson.map.introspect.AnnotatedMember;
import org.codehaus.jackson.map.introspect.AnnotatedMethod;
import org.codehaus.jackson.map.introspect.VisibilityChecker;
import org.codehaus.jackson.map.type.TypeBindings;
import org.codehaus.jackson.map.util.Annotations;
import org.codehaus.jackson.type.JavaType;

/**
 * Basic container for information gathered by {@link ClassIntrospector} to
 * help in constructing serializers and deserializers.
 * Note that the main implementation type is
 * {@link org.codehaus.jackson.map.introspect.BasicBeanDescription},
 * meaning that it is safe to upcast to this type.
 * 
 * @author tatu
 */
public abstract class BeanDescription
{
    /*
    /**********************************************************
    /* Configuration
    /**********************************************************
     */

    /**
     * Bean type information, including raw class and possible
     * * generics information
     */
    protected final JavaType _type;

    /*
    /**********************************************************
    /* Life-cycle
    /**********************************************************
     */

    protected BeanDescription(JavaType type)
    {
    	_type = type;
    }

    /*
    /**********************************************************
    /* Simple accesors
    /**********************************************************
     */

    /**
     * Method for accessing declared type of bean being introspected,
     * including full generic type information (from declaration)
     */
    public JavaType getType() { return _type; }

    public Class getBeanClass() { return _type.getRawClass(); }

    public abstract AnnotatedClass getClassInfo();
    
    public abstract boolean hasKnownClassAnnotations();

    /**
     * Accessor for type bindings that may be needed to fully resolve
     * types of member object, such as return and argument types of
     * methods and constructors, and types of fields.
     */
    public abstract TypeBindings bindingsForBeanType();

    /**
     * Method for resolving given JDK type, using this bean as the
     * generic type resolution context.
     * 
     * @since 1.9
     */
    public abstract JavaType resolveType(java.lang.reflect.Type jdkType);
    
    /**
     * Method for accessing collection of annotations the bean
     * class has.
     * 
     * @since 1.7
     */
    public abstract Annotations getClassAnnotations();
    
    /*
    /**********************************************************
    /* Basic API for finding properties, related
    /**********************************************************
     */
    
    /**
     * @return Ordered Map with logical property name as key, and
     *    matching getter method as value.
     *    
     * @since 1.9
     */
    public abstract List findProperties();

    /**
     * @since 1.9
     */
    public abstract Map findInjectables();
    
    /**
     * @since 1.9
     */
    public abstract AnnotatedMethod findAnyGetter();

    /**
     * @since 1.9
     */
    public abstract AnnotatedMethod findAnySetter();

    /**
     * @since 1.9
     */
    public abstract AnnotatedMethod findJsonValueMethod();

    /**
     * @since 1.9
     */
    public abstract AnnotatedConstructor findDefaultConstructor();
    
    /**
     * @since 1.9
     */
    public abstract Set getIgnoredPropertyNames();

    /*
    /**********************************************************
    /* Deprecated methods
    /**********************************************************
     */

    /**
     * @deprecated Since 1.9 use {@link #findProperties}
     */
    @Deprecated
    public abstract LinkedHashMap findGetters(VisibilityChecker visibilityChecker,
            Collection ignoredProperties);

    /**
     * @deprecated Since 1.9 use {@link #findProperties}
     */
    @Deprecated
    public abstract LinkedHashMap findSetters(VisibilityChecker visibilityChecker);

    /**
     * @deprecated Since 1.9 use {@link #findProperties}
     */
    @Deprecated
    public abstract LinkedHashMap findDeserializableFields(VisibilityChecker visibilityChecker,
            Collection ignoredProperties);

    /**
     * @deprecated Since 1.9 use the non-deprecated version
     */
    @Deprecated
    public abstract Map findSerializableFields(VisibilityChecker visibilityChecker,
            Collection ignoredProperties);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy