public static enum SmileGenerator.Feature extends java.lang.Enum<SmileGenerator.Feature>
Enum Constant | Description |
---|---|
CHECK_SHARED_NAMES |
Whether generator should check if it can "share" field names during generating
content or not.
|
CHECK_SHARED_STRING_VALUES |
Whether generator should check if it can "share" short (at most 64 bytes encoded)
String value during generating
content or not.
|
ENCODE_BINARY_AS_7BIT |
Whether to use simple 7-bit per byte encoding for binary content when output.
|
WRITE_END_MARKER |
Whether write byte marker that signifies end of logical content segment
(
SmileConstants.BYTE_MARKER_END_OF_CONTENT ) when
SmileGenerator.close() is called or not. |
WRITE_HEADER |
Whether to write 4-byte header sequence when starting output or not.
|
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
_defaultState |
|
protected int |
_mask |
Modifier and Type | Method | Description |
---|---|---|
static int |
collectDefaults() |
Method that calculates bit set (flags) of all features that
are enabled by default.
|
boolean |
enabledByDefault() |
|
int |
getMask() |
|
static SmileGenerator.Feature |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static SmileGenerator.Feature[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SmileGenerator.Feature WRITE_HEADER
Default setting is true, meaning that header will be written.
public static final SmileGenerator.Feature WRITE_END_MARKER
SmileConstants.BYTE_MARKER_END_OF_CONTENT
) when
SmileGenerator.close()
is called or not. This can be useful when outputting
multiple adjacent logical content segments (documents) into single
physical output unit (file).
Default setting is false meaning that such marker is not written.
public static final SmileGenerator.Feature ENCODE_BINARY_AS_7BIT
Default setting is true, indicating that binary data is quoted as 7-bit bytes instead of written raw.
public static final SmileGenerator.Feature CHECK_SHARED_NAMES
Since field names tend to repeat quite often, this setting is enabled by default.
public static final SmileGenerator.Feature CHECK_SHARED_STRING_VALUES
Since efficiency of this option depends a lot on type of content being produced, this option is disabled by default, and should only be enabled if it is likely that same values repeat relatively often.
public static SmileGenerator.Feature[] values()
for (SmileGenerator.Feature c : SmileGenerator.Feature.values()) System.out.println(c);
public static SmileGenerator.Feature valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static int collectDefaults()
public boolean enabledByDefault()
public int getMask()