Interface FormatFeature

  • All Superinterfaces:
    JacksonFeature
    All Known Implementing Classes:
    JsonReadFeature, JsonWriteFeature

    public interface FormatFeature
    extends JacksonFeature
    Marker interface that is to be implemented by data format - specific features. Interface used since Java Enums can not extend classes or other Enums, but they can implement interfaces; and as such we may be able to use limited amount of generic functionality.

    Since 2.12 this is more of an extra marker feature, as its core API is now defined in more general JacksonFeature.

    Since:
    2.6
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean enabledByDefault()
      Accessor for checking whether this feature is enabled by default.
      boolean enabledIn​(int flags)
      Convenience method for checking whether feature is enabled in given bitmask
      int getMask()
      Returns bit mask for this feature instance; must be a single bit, that is of form (1 << N)
    • Method Detail

      • enabledByDefault

        boolean enabledByDefault()
        Accessor for checking whether this feature is enabled by default.
        Specified by:
        enabledByDefault in interface JacksonFeature
        Returns:
        Whether this instance is enabled by default or not
      • getMask

        int getMask()
        Returns bit mask for this feature instance; must be a single bit, that is of form (1 << N)
        Specified by:
        getMask in interface JacksonFeature
        Returns:
        Bit mask of this feature
      • enabledIn

        boolean enabledIn​(int flags)
        Convenience method for checking whether feature is enabled in given bitmask
        Specified by:
        enabledIn in interface JacksonFeature
        Parameters:
        flags - Bit field that contains a set of enabled features of this type
        Returns:
        True if this feature is enabled in passed bit field