Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.BeanDescription


            name = _typeToId.get(key);
            if (name == null) {
                // 24-Feb-2011, tatu: As per [JACKSON-498], may need to dynamically look up name
                // can either throw an exception, or use default name...
                if (_config.isAnnotationProcessingEnabled()) {
                    BeanDescription beanDesc = _config.introspectClassAnnotations(cls);
                    name = _config.getAnnotationIntrospector().findTypeName(beanDesc.getClassInfo());
                }
                if (name == null) {
                    // And if still not found, let's choose default?
                    name = _defaultTypeId(cls);
                }
View Full Code Here


    Assert.notNull(mapper, "ObjectMapper must not be null!");
    Assert.notNull(type, "Type must not be null!");

    SerializationConfig serializationConfig = mapper.getSerializationConfig();
    JavaType javaType = serializationConfig.constructType(type);
    BeanDescription description = serializationConfig.introspect(javaType);

    this.definitions = description.findProperties();
  }
View Full Code Here

    if (entity == null) {
      return null;
    }

    BeanDescription description = introspector.forDeserialization(mapper.getDeserializationConfig(),
        mapper.constructType(object.getClass()), mapper.getDeserializationConfig());

    for (BeanPropertyDefinition definition : description.findProperties()) {
      if (definition.getName().equals(fieldName)) {
        return entity.getPersistentProperty(definition.getInternalName());
      }
    }
View Full Code Here

            name = _typeToId.get(key);
            if (name == null) {
                // 24-Feb-2011, tatu: As per [JACKSON-498], may need to dynamically look up name
                // can either throw an exception, or use default name...
                if (_config.isAnnotationProcessingEnabled()) {
                    BeanDescription beanDesc = _config.introspectClassAnnotations(cls);
                    name = _config.getAnnotationIntrospector().findTypeName(beanDesc.getClassInfo());
                }
                if (name == null) {
                    // And if still not found, let's choose default?
                    name = _defaultTypeId(cls);
                }
View Full Code Here

            name = _typeToId.get(key);
            if (name == null) {
                // 24-Feb-2011, tatu: As per [JACKSON-498], may need to dynamically look up name
                // can either throw an exception, or use default name...
                if (_config.isAnnotationProcessingEnabled()) {
                    BeanDescription beanDesc = _config.introspectClassAnnotations(cls);
                    name = _config.getAnnotationIntrospector().findTypeName(beanDesc.getClassInfo());
                }
                if (name == null) {
                    // And if still not found, let's choose default?
                    name = _defaultTypeId(cls);
                }
View Full Code Here

    @Test
    public void testIntermediateMixin() {
        objectMapper.addMixInAnnotations( BaseClass.class, MixIn.class );

        JavaType type = objectMapper.getTypeFactory().constructType( LeafClass.class );
        BeanDescription desc = objectMapper.getSerializationConfig().introspect( type );
        List<BeanPropertyDefinition> props = desc.findProperties();

        MixinSerForMethodsTester.INSTANCE.testIntermediateMixin( createWriter( LeafClass.class ) );
    }
View Full Code Here

     * jackson-databind has it available via DeserializationConfig)
     */
    private TypeDeserializer _findTypeDeserializer(DeserializationConfig cfg, JavaType baseType)
        throws JsonMappingException
    {
        BeanDescription bean = cfg.introspectClassAnnotations(baseType.getRawClass());
        AnnotatedClass ac = bean.getClassInfo();
        TypeResolverBuilder<?> b = cfg.getAnnotationIntrospector().findTypeResolver(cfg, ac, baseType);

        Collection<NamedType> subtypes = null;
        if (b == null) {
            b = cfg.getDefaultTyper(baseType);
View Full Code Here

            name = _typeToId.get(key);
            if (name == null) {
                // 24-Feb-2011, tatu: As per [JACKSON-498], may need to dynamically look up name
                // can either throw an exception, or use default name...
                if (_config.isAnnotationProcessingEnabled()) {
                    BeanDescription beanDesc = _config.introspectClassAnnotations(cls);
                    name = _config.getAnnotationIntrospector().findTypeName(beanDesc.getClassInfo());
                }
                if (name == null) {
                    // And if still not found, let's choose default?
                    name = _defaultTypeId(cls);
                }
View Full Code Here

            name = _typeToId.get(key);
            if (name == null) {
                // 24-Feb-2011, tatu: As per [JACKSON-498], may need to dynamically look up name
                // can either throw an exception, or use default name...
                if (_config.isAnnotationProcessingEnabled()) {
                    BeanDescription beanDesc = _config.introspectClassAnnotations(cls);
                    name = _config.getAnnotationIntrospector().findTypeName(beanDesc.getClassInfo());
                }
                if (name == null) {
                    // And if still not found, let's choose default?
                    name = _defaultTypeId(cls);
                }
View Full Code Here

                                         Object beanOrClass,
                                         String propertyName) throws IOException, JsonProcessingException {
        ObjectCodec objectCodec = jp.getCodec();
        if (objectCodec instanceof ObjectMapper) {
            ObjectMapper objectMapper = (ObjectMapper) objectCodec;
            BeanDescription beanDescription =
                    objectMapper.getSerializationConfig().introspect(ctxt.constructType(beanOrClass.getClass()));
            for (BeanPropertyDefinition propertyDefinition : beanDescription.findProperties()) {
                if (propertyName.equals(propertyDefinition.getName())) {
                    jp.skipChildren();
                    return true;
                }
            }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.databind.BeanDescription

Copyright © 2018 www.massapicom. 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.