Example usage for com.fasterxml.jackson.databind.introspect BeanPropertyDefinition isExplicitlyIncluded

List of usage examples for com.fasterxml.jackson.databind.introspect BeanPropertyDefinition isExplicitlyIncluded

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.introspect BeanPropertyDefinition isExplicitlyIncluded.

Prototype

public abstract boolean isExplicitlyIncluded();

Source Link

Usage

From source file:nl.talsmasoftware.enumerables.support.json.jackson2.EnumerableSerializer.java

private void serializeObject(Enumerable value, JsonGenerator jgen, SerializationConfig config)
        throws IOException {
    jgen.writeStartObject();//w  ww. j a  v  a 2  s .c om
    for (BeanPropertyDefinition property : serializationPropertiesFor(value.getClass(), config)) {
        if (property.couldSerialize()) {
            final Object propertyValue = property.getAccessor().getValue(value);
            if (propertyValue != null || property.isExplicitlyIncluded() || mustIncludeNull(config)) {
                jgen.writeObjectField(property.getName(), propertyValue);
            }
        }
    }
    jgen.writeEndObject();
}