Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.codehaus.jackson.map.ser;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.codehaus.jackson.map.AnnotationIntrospector;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.TypeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
import org.codehaus.jackson.map.introspect.Annotated;
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.BasicBeanDescription;
import org.codehaus.jackson.map.type.TypeFactory;
import org.codehaus.jackson.map.util.Annotations;
import org.codehaus.jackson.type.JavaType;
/**
* Helper class for {@link BeanSerializerFactory} that is used to
* construct {@link BeanPropertyWriter} instances. Can be sub-classed
* to change behavior.
*/
public class PropertyBuilder
{
final protected SerializationConfig _config;
final protected BasicBeanDescription _beanDesc;
final protected JsonSerialize.Inclusion _outputProps;
final protected AnnotationIntrospector _annotationIntrospector;
/**
* If a property has serialization inclusion value of
* {@link Inclusion#ALWAYS}, we need to know the default
* value of the bean, to know if property value equals default
* one.
*/
protected Object _defaultBean;
public PropertyBuilder(SerializationConfig config, BasicBeanDescription beanDesc)
{
_config = config;
_beanDesc = beanDesc;
_outputProps = beanDesc.findSerializationInclusion(config.getSerializationInclusion());
_annotationIntrospector = _config.getAnnotationIntrospector();
}
/*
/**********************************************************
/* Public API
/**********************************************************
*/
public Annotations getClassAnnotations() {
return _beanDesc.getClassAnnotations();
}
/**
* @param contentTypeSer Optional explicit type information serializer
* to use for contained values (only used for properties that are
* of container type)
*/
protected BeanPropertyWriter buildWriter(String name, JavaType declaredType,
JsonSerializer