/** * Accessor for getting bean description that only contains class * annotations: useful if no getter/setter/creator information is needed. */ public BeanDescription introspectClassAnnotations(Class<?> cls) { return introspectClassAnnotations(constructType(cls)); }
/** * Accessor for getting bean description that only contains immediate class * annotations: ones from the class, and its direct mix-in, if any, but * not from super types. */ public BeanDescription introspectDirectClassAnnotations(Class<?> cls) { return introspectDirectClassAnnotations(constructType(cls)); }
idToType.put(id, config.constructType(cls));
for (int i = 0, len = attrs.length; i < len; ++i) { if (propType == null) { propType = config.constructType(Object.class);
protected BeanPropertyWriter _constructVirtualProperty(JsonAppend.Prop prop, MapperConfig<?> config, AnnotatedClass ac) { PropertyMetadata metadata = prop.required() ? PropertyMetadata.STD_REQUIRED : PropertyMetadata.STD_OPTIONAL; PropertyName propName = _propertyName(prop.name(), prop.namespace()); JavaType type = config.constructType(prop.type()); // now, then, we need a placeholder for member (no real Field/Method): AnnotatedMember member = new VirtualAnnotatedMember(ac, ac.getRawType(), propName.getSimpleName(), type); // and with that and property definition SimpleBeanPropertyDefinition propDef = SimpleBeanPropertyDefinition.construct(config, member, propName, metadata, prop.include()); Class<?> implClass = prop.value(); HandlerInstantiator hi = config.getHandlerInstantiator(); VirtualBeanPropertyWriter bpw = (hi == null) ? null : hi.virtualPropertyWriterInstance(config, implClass); if (bpw == null) { bpw = (VirtualBeanPropertyWriter) ClassUtil.createInstance(implClass, config.canOverrideAccessModifiers()); } // one more thing: give it necessary contextual information return bpw.withConfig(config, ac, propDef, type); }
private Map<String, JavaType> generateFieldValueMappings() { Map<String, JavaType> mappings = new HashMap<String, JavaType>(); mappings.put("address", mapperConfig.constructType(AddressField.class)); mappings.put("name", mapperConfig.constructType(NameField.class)); mappings.put("anniversary", mapperConfig.constructType(DateField.class)); mappings.put("birthday", mapperConfig.constructType(DateField.class)); mappings.put("guid", mapperConfig.constructType(SingleValueField.class)); mappings.put("nickname", mapperConfig.constructType(SingleValueField.class)); mappings.put("email", mapperConfig.constructType(SingleValueField.class)); mappings.put("yahooid", mapperConfig.constructType(SingleValueField.class)); mappings.put("otherid", mapperConfig.constructType(SingleValueField.class)); mappings.put("phone", mapperConfig.constructType(SingleValueField.class)); mappings.put("jobTitle", mapperConfig.constructType(SingleValueField.class)); mappings.put("company", mapperConfig.constructType(SingleValueField.class)); mappings.put("notes", mapperConfig.constructType(SingleValueField.class)); mappings.put("link", mapperConfig.constructType(SingleValueField.class)); mappings.put("custom", mapperConfig.constructType(SingleValueField.class)); return mappings; } }
/** * Accessor for getting bean description that only contains immediate class * annotations: ones from the class, and its direct mix-in, if any, but * not from super types. */ public abstract BeanDescription introspectDirectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains immediate class * annotations: ones from the class, and its direct mix-in, if any, but * not from super types. */ public abstract BeanDescription introspectDirectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains class * annotations: useful if no getter/setter/creator information is needed. */ public abstract BeanDescription introspectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains class * annotations: useful if no getter/setter/creator information is needed. */ public abstract BeanDescription introspectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains class * annotations: useful if no getter/setter/creator information is needed. */ public abstract BeanDescription introspectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains class * annotations: useful if no getter/setter/creator information is needed. */ public abstract BeanDescription introspectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains immediate class * annotations: ones from the class, and its direct mix-in, if any, but * not from super types. */ public abstract BeanDescription introspectDirectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains class * annotations: useful if no getter/setter/creator information is needed. */ public BeanDescription introspectClassAnnotations(Class<?> cls) { return introspectClassAnnotations(constructType(cls)); }
/** * Accessor for getting bean description that only contains immediate class * annotations: ones from the class, and its direct mix-in, if any, but * not from super types. */ public BeanDescription introspectDirectClassAnnotations(Class<?> cls) { return introspectDirectClassAnnotations(constructType(cls)); }
/** * Accessor for getting bean description that only contains class * annotations: useful if no getter/setter/creator information is needed. */ public abstract BeanDescription introspectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains immediate class * annotations: ones from the class, and its direct mix-in, if any, but * not from super types. */ public abstract BeanDescription introspectDirectClassAnnotations(JavaType type);
/** * Accessor for getting bean description that only contains immediate class * annotations: ones from the class, and its direct mix-in, if any, but * not from super types. */ public abstract BeanDescription introspectDirectClassAnnotations(JavaType type);
protected BeanPropertyWriter _constructVirtualProperty(JsonAppend.Prop prop, MapperConfig<?> config, AnnotatedClass ac) { PropertyMetadata metadata = prop.required() ? PropertyMetadata.STD_REQUIRED : PropertyMetadata.STD_OPTIONAL; PropertyName propName = _propertyName(prop.name(), prop.namespace()); JavaType type = config.constructType(prop.type()); // now, then, we need a placeholder for member (no real Field/Method): AnnotatedMember member = new VirtualAnnotatedMember(ac, ac.getRawType(), propName.getSimpleName(), type); // and with that and property definition SimpleBeanPropertyDefinition propDef = SimpleBeanPropertyDefinition.construct(config, member, propName, metadata, prop.include()); Class<?> implClass = prop.value(); HandlerInstantiator hi = config.getHandlerInstantiator(); VirtualBeanPropertyWriter bpw = (hi == null) ? null : hi.virtualPropertyWriterInstance(config, implClass); if (bpw == null) { bpw = (VirtualBeanPropertyWriter) ClassUtil.createInstance(implClass, config.canOverrideAccessModifiers()); } // one more thing: give it necessary contextual information return bpw.withConfig(config, ac, propDef, type); }
protected BeanPropertyWriter _constructVirtualProperty(JsonAppend.Prop prop, MapperConfig<?> config, AnnotatedClass ac) { PropertyMetadata metadata = prop.required() ? PropertyMetadata.STD_REQUIRED : PropertyMetadata.STD_OPTIONAL; PropertyName propName = _propertyName(prop.name(), prop.namespace()); JavaType type = config.constructType(prop.type()); // now, then, we need a placeholder for member (no real Field/Method): AnnotatedMember member = new VirtualAnnotatedMember(ac, ac.getRawType(), propName.getSimpleName(), type.getRawClass()); // and with that and property definition SimpleBeanPropertyDefinition propDef = SimpleBeanPropertyDefinition.construct(config, member, propName, metadata, prop.include()); Class<?> implClass = prop.value(); HandlerInstantiator hi = config.getHandlerInstantiator(); VirtualBeanPropertyWriter bpw = (hi == null) ? null : hi.virtualPropertyWriterInstance(config, implClass); if (bpw == null) { bpw = (VirtualBeanPropertyWriter) ClassUtil.createInstance(implClass, config.canOverrideAccessModifiers()); } // one more thing: give it necessary contextual information return bpw.withConfig(config, ac, propDef, type); }