Class SimpleBeanPropertyFilter

    • Method Detail

      • serializeAll

        public static SimpleBeanPropertyFilter serializeAll()
        Convenience factory method that will return a "no-op" filter that will simply just serialize all properties that are given, and filter out nothing.
        Since:
        2.6
      • serializeAll

        @Deprecated
        public static SimpleBeanPropertyFilter serializeAll​(java.util.Set<java.lang.String> properties)
        Deprecated.
        Since 2.6; to be removed from 2.7
        Factory method that was accidentally added in 2.5 with arguments; basically works just as an alias of filterOutAllExcept(Set) which is not very useful. Instead, see serializeAll() for intended signature.
      • filterOutAllExcept

        public static SimpleBeanPropertyFilter filterOutAllExcept​(java.util.Set<java.lang.String> properties)
        Factory method to construct filter that filters out all properties except ones includes in set
      • serializeAllExcept

        public static SimpleBeanPropertyFilter serializeAllExcept​(java.util.Set<java.lang.String> properties)
      • serializeAsField

        @Deprecated
        public void serializeAsField​(java.lang.Object bean,
                                     JsonGenerator jgen,
                                     SerializerProvider provider,
                                     BeanPropertyWriter writer)
                              throws java.lang.Exception
        Deprecated.
        Description copied from interface: BeanPropertyFilter
        Method called by BeanSerializer to let filter decide what to do with given bean property value: the usual choices are to either filter out (i.e. do nothing) or write using given BeanPropertyWriter, although filters can choose other to do something different altogether.

        Typical implementation is something like:

         if (include(writer)) {
              writer.serializeAsField(pojo, jgen, prov);
         }
        
        Specified by:
        serializeAsField in interface BeanPropertyFilter
        Parameters:
        bean - Object that contains property value to serialize
        jgen - Generator use for serializing value
        provider - Provider that can be used for accessing dynamic aspects of serialization processing
        writer - Default bean property serializer to use
        Throws:
        java.lang.Exception
      • depositSchemaProperty

        @Deprecated
        public void depositSchemaProperty​(BeanPropertyWriter writer,
                                          ObjectNode propertiesNode,
                                          SerializerProvider provider)
                                   throws JsonMappingException
        Deprecated.
        Description copied from interface: BeanPropertyFilter
        Method called by BeanSerializer to let the filter determine whether, and in what form the given property exist within the parent, or root, schema. Filters can omit adding the property to the node, or choose the form of the schema value for the property.

        Typical implementation is something like:

         if (include(writer)) {
              writer.depositSchemaProperty(propertiesNode, provider);
         }
        
        Specified by:
        depositSchemaProperty in interface BeanPropertyFilter
        Parameters:
        writer - Bean property writer to use to create schema value
        propertiesNode - Node which the given property would exist within
        provider - Provider that can be used for accessing dynamic aspects of serialization processing
        Throws:
        JsonMappingException
      • depositSchemaProperty

        @Deprecated
        public void depositSchemaProperty​(BeanPropertyWriter writer,
                                          JsonObjectFormatVisitor objectVisitor,
                                          SerializerProvider provider)
                                   throws JsonMappingException
        Deprecated.
        Description copied from interface: BeanPropertyFilter
        Method called by BeanSerializer to let the filter determine whether, and in what form the given property exist within the parent, or root, schema. Filters can omit adding the property to the node, or choose the form of the schema value for the property

        Typical implementation is something like:

         if (include(writer)) {
              writer.depositSchemaProperty(objectVisitor, provider);
         }
        
        Specified by:
        depositSchemaProperty in interface BeanPropertyFilter
        Parameters:
        writer - Bean property serializer to use to create schema value
        objectVisitor - JsonObjectFormatVisitor which should be aware of the property's existence
        provider - Provider that can be used for accessing dynamic aspects of serialization processing
        Throws:
        JsonMappingException
      • serializeAsField

        public void serializeAsField​(java.lang.Object pojo,
                                     JsonGenerator jgen,
                                     SerializerProvider provider,
                                     PropertyWriter writer)
                              throws java.lang.Exception
        Description copied from interface: PropertyFilter
        Method called by BeanSerializer to let the filter decide what to do with given bean property value: the usual choices are to either filter out (i.e. do nothing) or write using given PropertyWriter, although filters can choose other to do something different altogether.

        Typical implementation is something like:

         if (include(writer)) {
              writer.serializeAsField(pojo, gen, prov);
         }
        
        Specified by:
        serializeAsField in interface PropertyFilter
        Parameters:
        pojo - Object that contains property value to serialize
        jgen - Generator use for serializing value
        provider - Provider that can be used for accessing dynamic aspects of serialization processing
        writer - Object called to do actual serialization of the field, if not filtered out
        Throws:
        java.lang.Exception
      • serializeAsElement

        public void serializeAsElement​(java.lang.Object elementValue,
                                       JsonGenerator jgen,
                                       SerializerProvider provider,
                                       PropertyWriter writer)
                                throws java.lang.Exception
        Description copied from interface: PropertyFilter
        Method called by container to let the filter decide what to do with given element value: the usual choices are to either filter out (i.e. do nothing) or write using given PropertyWriter, although filters can choose other to do something different altogether.

        Typical implementation is something like:

         if (include(writer)) {
              writer.serializeAsElement(pojo, gen, prov);
         }
        
        Specified by:
        serializeAsElement in interface PropertyFilter
        Parameters:
        elementValue - Element value being serializerd
        jgen - Generator use for serializing value
        provider - Provider that can be used for accessing dynamic aspects of serialization processing
        writer - Object called to do actual serialization of the field, if not filtered out
        Throws:
        java.lang.Exception
      • depositSchemaProperty

        @Deprecated
        public void depositSchemaProperty​(PropertyWriter writer,
                                          ObjectNode propertiesNode,
                                          SerializerProvider provider)
                                   throws JsonMappingException
        Deprecated.
        Description copied from interface: PropertyFilter
        Method called by BeanSerializer to let the filter determine whether, and in what form the given property exist within the parent, or root, schema. Filters can omit adding the property to the node, or choose the form of the schema value for the property.

        Typical implementation is something like:

         if (include(writer)) {
              writer.depositSchemaProperty(propertiesNode, provider);
         }
        
        Specified by:
        depositSchemaProperty in interface PropertyFilter
        Parameters:
        writer - Bean property writer to use to create schema value
        propertiesNode - Node which the given property would exist within
        provider - Provider that can be used for accessing dynamic aspects of serialization processing
        Throws:
        JsonMappingException
      • depositSchemaProperty

        public void depositSchemaProperty​(PropertyWriter writer,
                                          JsonObjectFormatVisitor objectVisitor,
                                          SerializerProvider provider)
                                   throws JsonMappingException
        Description copied from interface: PropertyFilter
        Method called by BeanSerializer to let the filter determine whether, and in what form the given property exist within the parent, or root, schema. Filters can omit adding the property to the node, or choose the form of the schema value for the property

        Typical implementation is something like:

         if (include(writer)) {
              writer.depositSchemaProperty(objectVisitor, provider);
         }
        
        Specified by:
        depositSchemaProperty in interface PropertyFilter
        Parameters:
        writer - Bean property serializer to use to create schema value
        objectVisitor - JsonObjectFormatVisitor which should be aware of the property's existence
        provider - Provider that can be used for accessing dynamic aspects of serialization processing
        Throws:
        JsonMappingException