Class VersionPropertyFilter

java.lang.Object
com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter
net.sf.jasperreports.jackson.util.VersionPropertyFilter
All Implemented Interfaces:
com.fasterxml.jackson.databind.ser.BeanPropertyFilter, com.fasterxml.jackson.databind.ser.PropertyFilter

public class VersionPropertyFilter extends com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter
A Jackson property filter that excludes properties annotated with JRXmlSince when the target version (passed via serialization attributes) is older than the version in which the property was introduced.

The target version is read from the serialization attribute ATTRIBUTE_TARGET_VERSION. When no target version is set, all properties are serialized (current version behavior).

Author:
Teodor Danciu (teodord@users.sourceforge.net)
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter

    com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.FilterExceptFilter, com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.SerializeExceptFilter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The serialization attribute key used to pass the target JRXML version to the filter via ObjectWriter.withAttribute().
    static final String
    The filter ID used with Jackson's @JsonFilter and SimpleFilterProvider.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    serializeAsField(Object pojo, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.ser.PropertyWriter writer)
     

    Methods inherited from class com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter

    depositSchemaProperty, depositSchemaProperty, depositSchemaProperty, depositSchemaProperty, filterOutAll, filterOutAllExcept, filterOutAllExcept, from, include, include, includeElement, serializeAll, serializeAll, serializeAllExcept, serializeAllExcept, serializeAsElement, serializeAsField

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ATTRIBUTE_TARGET_VERSION

      public static final String ATTRIBUTE_TARGET_VERSION
      The serialization attribute key used to pass the target JRXML version to the filter via ObjectWriter.withAttribute().
      See Also:
    • FILTER_ID

      public static final String FILTER_ID
      The filter ID used with Jackson's @JsonFilter and SimpleFilterProvider.
      See Also:
  • Constructor Details

    • VersionPropertyFilter

      public VersionPropertyFilter()
  • Method Details

    • serializeAsField

      public void serializeAsField(Object pojo, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.ser.PropertyWriter writer) throws Exception
      Specified by:
      serializeAsField in interface com.fasterxml.jackson.databind.ser.PropertyFilter
      Overrides:
      serializeAsField in class com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter
      Throws:
      Exception