Cowtowncoder | 2e262b9 | 2015-05-27 17:32:17 -0700 | [diff] [blame] | 1 | package 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 | */ |
| 16 | public 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 Saloranta | 6f41628 | 2015-07-10 20:25:49 -0700 | [diff] [blame] | 25 | * that is of form <code>(1 << N)</code> |
Cowtowncoder | 2e262b9 | 2015-05-27 17:32:17 -0700 | [diff] [blame] | 26 | */ |
| 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 | } |