blob: e775e4ce3014d9b97fc07be513aed472c9521788 [file] [log] [blame]
Cowtowncoder2e262b92015-05-27 17:32:17 -07001package com.fasterxml.jackson.core;
2
3/**
4 * Marker interface that is to be implemented by data format - specific features.
5 * Interface used since Java Enums can not extend classes or other Enums, but
6 * they can implement interfaces; and as such we may be able to use limited
7 * amount of generic functionality.
8 *<p>
9 * Note that this type is only implemented by non-JSON formats:
10 * types {@link JsonParser.Feature} and {@link JsonGenerator.Feature} do NOT
11 * implement it. This is to make it easier to avoid ambiguity with method
12 * calls.
13 *
14 * @since 2.6 (to be fully used in 2.7 and beyond)
15 */
16public interface FormatFeature
17{
18 /**
19 * Accessor for checking whether this feature is enabled by default.
20 */
21 public boolean enabledByDefault();
22
23 /**
24 * Returns bit mask for this feature instance; must be a single bit,
Tatu Saloranta6f416282015-07-10 20:25:49 -070025 * that is of form <code>(1 &lt;&lt; N)</code>
Cowtowncoder2e262b92015-05-27 17:32:17 -070026 */
27 public int getMask();
28
29 /**
30 * Convenience method for checking whether feature is enabled in given bitmask
31 */
32 public boolean enabledIn(int flags);
33}