public static enum SmileGenerator.Feature extends Enum<SmileGenerator.Feature>
枚举常量和说明 |
---|
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.
|
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
_defaultState |
protected int |
_mask |
限定符和类型 | 方法和说明 |
---|---|
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(String name)
返回带有指定名称的该类型的枚举常量。
|
static SmileGenerator.Feature[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
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(String name)
name
- 要返回的枚举常量的名称。如果该枚举类型没有带有指定名称的常量,
- 则抛出 IllegalArgumentException如果参数为空值,
- 则抛出 NullPointerExceptionpublic static int collectDefaults()
public boolean enabledByDefault()
public int getMask()