Examples of AnnotatedClass


Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

    }

    public void testFieldIntrospection()
    {
        // null -> no mix-in annotations
        AnnotatedClass ac = AnnotatedClass.construct(FieldBean.class, new JacksonAnnotationIntrospector(), null);
        ac.resolveFields();
        /* 14-Jul-2009, tatu: AnnotatedClass does remove forcibly ignored
         *   entries, but will still contain non-public fields too (earlier
         *   versions didn't, but filtering was moved to a later point)
         */
        assertEquals(2, ac.getFieldCount());
        for (AnnotatedField f : ac.fields()) {
            String fname = f.getName();
            if (!"bar".equals(fname) && !"props".equals(fname)) {
                fail("Unexpected field name '"+fname+"'");
            }
        }
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

        boolean isResolvable = (deser instanceof ResolvableDeserializer);
        boolean addToCache = (deser.getClass() == BeanDeserializer.class);
        if (!addToCache) {
            AnnotationIntrospector aintr = config.getAnnotationIntrospector();
            // note: pass 'null' to prevent mix-ins from being used
            AnnotatedClass ac = AnnotatedClass.construct(deser.getClass(), aintr, null);
            Boolean cacheAnn = aintr.findCachability(ac);
            if (cacheAnn != null) {
                addToCache = cacheAnn.booleanValue();
            }
        }
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

         *    'MixInResolver'; no mix-ins set at this point
         * 29-Jul-2009, tatu: Also, we do NOT ignore annotations here, even
         *    if Feature.USE_ANNOTATIONS was disabled, since caller
         *    specifically requested annotations to be added with this call
         */
        AnnotatedClass ac = AnnotatedClass.construct(cls, _annotationIntrospector, null);
        _visibilityChecker = _annotationIntrospector.findAutoDetectVisibility(ac, _visibilityChecker);

        // How about writing null property values?
        JsonSerialize.Inclusion incl = _annotationIntrospector.findSerializationInclusion(ac, null);
        if (incl != _serializationInclusion) {
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

         */

        /* 10-Jul-2009, tatu: Should be able to just pass null as
         *    'MixInResolver'; no mix-ins set at this point
         */
        AnnotatedClass ac = AnnotatedClass.construct(cls, _annotationIntrospector, null);
        // visibility checks handled via separate checker object...
        _visibilityChecker = _annotationIntrospector.findAutoDetectVisibility(ac, _visibilityChecker);
    }
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

     * checks annotations class may have.
     */
    protected List<BeanPropertyWriter> filterBeanProperties(SerializationConfig config, BasicBeanDescription beanDesc, List<BeanPropertyWriter> props)
    {
        AnnotationIntrospector intr = config.getAnnotationIntrospector();
        AnnotatedClass ac = beanDesc.getClassInfo();
        String[] ignored = intr.findPropertiesToIgnore(ac);
        if (ignored != null && ignored.length > 0) {
            HashSet<String> ignoredSet = ArrayBuilders.arrayToSet(ignored);
            Iterator<BeanPropertyWriter> it = props.iterator();
            while (it.hasNext()) {
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

         * and then for [JACKSON-170] (implicitly order creator properties before others)
         */
        List<String> creatorProps = beanDesc.findCreatorPropertyNames();
        // Then how about explicit ordering?
        AnnotationIntrospector intr = config.getAnnotationIntrospector();
        AnnotatedClass ac = beanDesc.getClassInfo();
        String[] propOrder = intr.findSerializationPropertyOrder(ac);
        Boolean alpha = intr.findSerializationSortAlphabetically(ac);
        boolean sort = (alpha != null) && alpha.booleanValue();
        if (sort || !creatorProps.isEmpty() || propOrder != null) {
            props = _sortBeanProperties(props, creatorProps, propOrder, sort);
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

     */
    @Override
    public TypeSerializer createTypeSerializer(JavaType baseType, SerializationConfig config)
    {
        BasicBeanDescription bean = config.introspectClassAnnotations(baseType.getRawClass());
        AnnotatedClass ac = bean.getClassInfo();
        AnnotationIntrospector ai = config.getAnnotationIntrospector();
        TypeResolverBuilder<?> b = ai.findTypeResolver(ac, baseType);
        /* Ok: if there is no explicit type info handler, we may want to
         * use a default. If so, config object knows what to use.
         */
 
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

    @Override
    public TypeDeserializer findTypeDeserializer(DeserializationConfig config, JavaType baseType)
    {
        Class<?> cls = baseType.getRawClass();
        BasicBeanDescription bean = config.introspectClassAnnotations(cls);
        AnnotatedClass ac = bean.getClassInfo();
        AnnotationIntrospector ai = config.getAnnotationIntrospector();
        TypeResolverBuilder<?> b = ai.findTypeResolver(ac, baseType);
        /* Ok: if there is no explicit type info handler, we may want to
         * use a default. If so, config object knows what to use.
         */
 
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

         *    'MixInResolver'; no mix-ins set at this point
         * 29-Jul-2009, tatu: Also, we do NOT ignore annotations here, even
         *    if Feature.USE_ANNOTATIONS was disabled, since caller
         *    specifically requested annotations to be added with this call
         */
        AnnotatedClass ac = AnnotatedClass.construct(cls, _annotationIntrospector, null);

        // Should we enable/disable setter auto-detection?
        Boolean ad = _annotationIntrospector.findGetterAutoDetection(ac);
        if (ad != null) {
            set(Feature.AUTO_DETECT_GETTERS, ad.booleanValue());
View Full Code Here

Examples of org.codehaus.jackson.map.introspect.AnnotatedClass

         */

        /* 10-Jul-2009, tatu: Should be able to just pass null as
         *    'MixInResolver'; no mix-ins set at this point
         */
        AnnotatedClass ac = AnnotatedClass.construct(cls, _annotationIntrospector, null);

        // Auto-detect setters, creators?
        Boolean ad = _annotationIntrospector.findSetterAutoDetection(ac);
        if (ad != null) {
            set(Feature.AUTO_DETECT_SETTERS, ad.booleanValue());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.