Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.ser;
 
Interface for objects that providers instances of PropertyFilter that match given ids. A provider is configured to be used during serialization, to find filter to used based on id specified by com.fasterxml.jackson.annotation.JsonFilter annotation on bean class.
public abstract class FilterProvider
{
    
Lookup method used to find BeanPropertyFilter that has specified id. Note that id is typically a java.lang.String, but is not necessarily limited to that; that is, while standard components use String, custom implementation can choose other kinds of keys.

Deprecated:
Since 2.3 deprecated because BeanPropertyFilter is deprecated;
Returns:
Filter registered with specified id, if one defined; null if none found.
    @Deprecated
    public abstract BeanPropertyFilter findFilter(Object filterId);

    
Lookup method used to find PropertyFilter that has specified id. Note that id is typically a java.lang.String, but is not necessarily limited to that; that is, while standard components use String, custom implementation can choose other kinds of keys.

This method is the replacement for findFilter(java.lang.Object) starting with 2.3.

Note that the default implementation is designed to support short-term backwards compatibility, and will call the deprecated findFilter method, then wrap filter if one found as PropertyFilter. It should be overridden by up-to-date implementations

Parameters:
filterId Id of the filter to fetch
valueToFilter Object being filtered (usually POJO, but may be a java.util.Map, or in future a container), if available; not available when generating schemas.
Returns:
Filter to use, if any.
Since:
2.3
    public PropertyFilter findPropertyFilter(Object filterIdObject valueToFilter)
    {
        @SuppressWarnings("deprecation")
        BeanPropertyFilter old = findFilter(filterId);
        if (old == null) {
            return null;
        }
        return SimpleBeanPropertyFilter.from(old);
    }
New to GrepCode? Check out our FAQ X