Class BeanSerializerBuilder


  • public class BeanSerializerBuilder
    extends java.lang.Object
    Builder class used for aggregating deserialization information about a POJO, in order to build a JsonSerializer for serializing intances. Main reason for using separate builder class is that this makes it easier to make actual serializer class fully immutable.
    • Constructor Detail

      • BeanSerializerBuilder

        public BeanSerializerBuilder​(BeanDescription beanDesc)
    • Method Detail

      • setProperties

        public void setProperties​(java.util.List<BeanPropertyWriter> properties)
      • setFilteredProperties

        public void setFilteredProperties​(BeanPropertyWriter[] properties)
        Parameters:
        properties - Number and order of properties here MUST match that of "regular" properties set earlier using setProperties(List); if not, an IllegalArgumentException will be thrown
      • setFilterId

        public void setFilterId​(java.lang.Object filterId)
      • setObjectIdWriter

        public void setObjectIdWriter​(ObjectIdWriter w)
      • hasProperties

        public boolean hasProperties()
      • getFilterId

        public java.lang.Object getFilterId()
      • build

        public JsonSerializer<?> build()
        Method called to create BeanSerializer instance with all accumulated information. Will construct a serializer if we have enough information, or return null if not.
      • createDummy

        public BeanSerializer createDummy()
        Factory method for constructing an "empty" serializer; one that outputs no properties (but handles JSON objects properly, including type information)