Interface ObjectMapper.Factory.Builder

  • Enclosing interface:
    ObjectMapper.Factory

    public static interface ObjectMapper.Factory.Builder
    A builder for a configured factory producing object mappers.

    In general, with multiple applicable resolvers, the one registered last will take priority.

    Since:
    4.0.0
    • Method Detail

      • addDiscoverer

        ObjectMapper.Factory.Builder addDiscoverer​(FieldDiscoverer<?> discoverer)
        Add a discoverer for a type of object.

        Field discoverers will be tried in order until one can produce the appropriate metadata.

        Parameters:
        discoverer - field discoverer
        Returns:
        this builder
        Since:
        4.0.0
      • addProcessor

        default <A extends AnnotationObjectMapper.Factory.Builder addProcessor​(Class<A> definition,
                                                                                 Processor.Factory<A,​Object> factory)
        Register a Processor that will process fields after write.

        Processors registered without a specific data type should be able to operate on any value type.

        Type Parameters:
        A - annotation type
        Parameters:
        definition - annotation providing data
        factory - factory for callback function
        Returns:
        this builder
        Since:
        4.0.0
      • addProcessor

        <A extends Annotation,​T> ObjectMapper.Factory.Builder addProcessor​(Class<A> definition,
                                                                                 Class<T> valueType,
                                                                                 Processor.Factory<A,​T> factory)
        Register a Processor that will process fields after write.

        All value types will be tested against types normalized to their boxed variants.

        Type Parameters:
        A - annotation type
        T - data type
        Parameters:
        definition - annotation providing data
        valueType - value types the processor will handle
        factory - factory for callback function
        Returns:
        this builder
        Since:
        4.0.0
      • addConstraint

        default <A extends AnnotationObjectMapper.Factory.Builder addConstraint​(Class<A> definition,
                                                                                  Constraint.Factory<A,​Object> factory)
        Register a Constraint that will be used to validate fields.

        Constraints registered without a specific data type will be able to operate on any value type.

        Type Parameters:
        A - annotation type
        Parameters:
        definition - annotations providing data
        factory - factory for callback function
        Returns:
        this builder
        Since:
        4.0.0
      • addConstraint

        <A extends Annotation,​T> ObjectMapper.Factory.Builder addConstraint​(Class<A> definition,
                                                                                  Class<T> valueType,
                                                                                  Constraint.Factory<A,​T> factory)
        Register a Constraint that will be used to validate fields.

        All value types will be tested against types normalized to their boxed variants.

        Type Parameters:
        A - annotation type
        T - data type
        Parameters:
        definition - annotations providing data
        valueType - value types the processor will handle
        factory - factory for callback function
        Returns:
        this builder
        Since:
        4.0.0
      • build

        ObjectMapper.Factory build()
        Create a new factory using the current configuration.
        Returns:
        new factory instance
        Since:
        4.0.0