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 com.fitbur.jackson.databind.ser;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.HashMap;
import com.fitbur.jackson.annotation.JsonInclude;
import com.fitbur.jackson.core.JsonGenerator;
import com.fitbur.jackson.core.SerializableString;
import com.fitbur.jackson.core.io.SerializedString;
import com.fitbur.jackson.databind.*;
import com.fitbur.jackson.databind.annotation.JacksonStdImpl;
import com.fitbur.jackson.databind.introspect.*;
import com.fitbur.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor;
import com.fitbur.jackson.databind.jsonschema.SchemaAware;
import com.fitbur.jackson.databind.jsontype.TypeSerializer;
import com.fitbur.jackson.databind.node.ObjectNode;
import com.fitbur.jackson.databind.ser.impl.PropertySerializerMap;
import com.fitbur.jackson.databind.ser.impl.UnwrappingBeanPropertyWriter;
import com.fitbur.jackson.databind.ser.std.BeanSerializerBase;
import com.fitbur.jackson.databind.util.Annotations;
import com.fitbur.jackson.databind.util.NameTransformer;
/**
* Base bean property handler class, which implements common parts of
* reflection-based functionality for accessing a property value
* and serializing it.
*
* Note that current design tries to keep instances immutable (semi-functional
* style); mostly because these instances are exposed to application
* code and this is to reduce likelihood of data corruption and
* synchronization issues.
*/
@JacksonStdImpl // since 2.6. NOTE: sub-classes typically are not
public class BeanPropertyWriter
extends PropertyWriter // which extends `ConcreteBeanPropertyBase`
implements java.io.Serializable // since 2.6
{
// As of 2.7
private static final long serialVersionUID = 1L;
/**
* Marker object used to indicate "do not serialize if empty"
*/
public final static Object MARKER_FOR_EMPTY = JsonInclude.Include.NON_EMPTY;
/*
/**********************************************************
/* Basic property metadata: name, type, other
/**********************************************************
*/
/**
* Logical name of the property; will be used as the field name
* under which value for the property is written.
*
* NOTE: do NOT change name of this field; it is accessed by
* Afterburner module (until 2.4; not directly from 2.5)
* ALSO NOTE: ... and while it really ought to be `SerializableString`,
* changing that is also binary-incompatible change. So nope.
*/
protected final SerializedString _name;
/**
* Wrapper name to use for this element, if any
*
* @since 2.2
*/
protected final PropertyName _wrapperName;
/**
* Type property is declared to have, either in class definition
* or associated annotations.
*/
protected final JavaType _declaredType;
/**
* Type to use for locating serializer; normally same as return
* type of the accessor method, but may be overridden by annotations.
*/
protected final JavaType _cfgSerializationType;
/**
* Base type of the property, if the declared type is "non-trivial";
* meaning it is either a structured type (collection, map, array),
* or parameterized. Used to retain type information about contained
* type, which is mostly necessary if type meta-data is to be
* included.
*/
protected JavaType _nonTrivialBaseType;
/**
* Annotations from context (most often, class that declares property,
* or in case of sub-class serializer, from that sub-class)
*
* NOTE: transient just to support JDK serializability; Annotations
* do not serialize. At all.
*/
protected final transient Annotations _contextAnnotations;
/*
/**********************************************************
/* Settings for accessing property value to serialize
/**********************************************************
*/
/**
* Member (field, method) that represents property and allows access
* to associated annotations.
*/
protected final AnnotatedMember _member;
/**
* Accessor method used to get property value, for
* method-accessible properties.
* Null if and only if {@link #_field} is null.
*
* `transient` (and non-final) only to support JDK serializability.
*/
protected transient Method _accessorMethod;
/**
* Field that contains the property value for field-accessible
* properties.
* Null if and only if {@link #_accessorMethod} is null.
*
* `transient` (and non-final) only to support JDK serializability.
*/
protected transient Field _field;
/*
/**********************************************************
/* Serializers needed
/**********************************************************
*/
/**
* Serializer to use for writing out the value: null if it can not
* be known statically; non-null if it can.
*/
protected JsonSerializer