public enum Option extends Enum<Option>
SchemaGeneratorConfigBuilder
instance.Enum Constant and Description |
---|
ADDITIONAL_FIXED_TYPES
Whether additional types (and not just primitives and their associated classes should be included as fixed schema with a
SchemaKeyword.TAG_TYPE attribute of "string"/"boolean"/"integer"/"number". |
ALLOF_CLEANUP_AT_THE_END
Whether as the last step of the schema generation, unnecessary "allOf" elements (i.e.
|
DEFINITION_FOR_MAIN_SCHEMA
Whether the schema for the target/main type should be included in the "definitions"/"$defs" – thereby avoiding an potential
"$ref": "#"
and assigning a name to it like for all other defined subschemas. |
DEFINITIONS_FOR_ALL_OBJECTS
Whether all referenced objects should be listed in the schema's "definitions"/"$defs".
|
FLATTENED_ENUMS
Whether enums should be treated as plain
SchemaKeyword.TAG_TYPE_STRING values – derived from their respective constant name. |
FLATTENED_ENUMS_FROM_TOSTRING
Whether enums should be treated as plain
SchemaKeyword.TAG_TYPE_STRING values – derived from their respective toString() . |
FLATTENED_OPTIONALS
Whether any
Optional instance should be treated as nullable value of the wrapped type. |
FORBIDDEN_ADDITIONAL_PROPERTIES_BY_DEFAULT
Whether a schema's "additionalProperties" should be set to "false" if no specific configuration says otherwise.
|
GETTER_METHODS
Whether getter methods should be included (assuming their fields are not included).
|
INLINE_ALL_SCHEMAS
Whether all sub-schemas should be defined in-line, i.e.
|
MAP_VALUES_AS_ADDITIONAL_PROPERTIES
Whether a
Map<K, V> schema's "additionalProperties" should be set to its declared value type V . |
NONPUBLIC_NONSTATIC_FIELDS_WITH_GETTERS
Whether fields with private/package/protected visibility, for which a respective getter method can be found, should be included.
|
NONPUBLIC_NONSTATIC_FIELDS_WITHOUT_GETTERS
Whether fields with private/package/protected visibility and no accompanying getter method should be included.
|
NONPUBLIC_STATIC_FIELDS
Whether
static fields with private/package/protected visibility should be included. |
NONSTATIC_NONVOID_NONGETTER_METHODS
Whether methods that are (1) not
static , (2) have a specific return value and (3) are not getters, should be included. |
NULLABLE_FIELDS_BY_DEFAULT
Whether an object's field/property should be deemed to be nullable if no specific check says otherwise.
|
NULLABLE_METHOD_RETURN_VALUES_BY_DEFAULT
Whether a method's return value should be deemed to be nullable if no specific check says otherwise.
|
PLAIN_DEFINITION_KEYS
Generally, keys in the collected "definitions"/"$defs" are ensured to be URI compatible but may include parentheses and commas for listing type
parameters.
|
PUBLIC_NONSTATIC_FIELDS
Whether
static fields with public visibility should be included. |
PUBLIC_STATIC_FIELDS
Whether
static fields with public visibility should be included. |
SCHEMA_VERSION_INDICATOR
Whether the
SchemaKeyword.TAG_SCHEMA attribute with SchemaKeyword.TAG_SCHEMA_VALUE should be included. |
SIMPLIFIED_ENUMS
Whether enums should be treated as
SchemaKeyword.TAG_TYPE_OBJECT , with all methods but name() being excluded. |
SIMPLIFIED_OPTIONALS
Whether any
Optional instance should be reduced to an object with only three methods. |
STATIC_METHODS
Whether methods that are
static should be included. |
TRANSIENT_FIELDS
Whether
transient fields should be included. |
VALUES_FROM_CONSTANT_FIELDS
Whether the constant values of static final fields should be included.
|
VOID_METHODS
Whether methods without return value (e.g.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isOverriding(Option otherOption)
Check whether the given option is being ignored if this one enabled.
|
static Option |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Option[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Option SCHEMA_VERSION_INDICATOR
SchemaKeyword.TAG_SCHEMA
attribute with SchemaKeyword.TAG_SCHEMA_VALUE
should be included.public static final Option ADDITIONAL_FIXED_TYPES
SchemaKeyword.TAG_TYPE
attribute of "string"/"boolean"/"integer"/"number".public static final Option SIMPLIFIED_ENUMS
SchemaKeyword.TAG_TYPE_OBJECT
, with all methods but name()
being excluded.
FLATTENED_ENUMS
and FLATTENED_ENUMS_FROM_TOSTRING
are disabled.FLATTENED_ENUMS
,
FLATTENED_ENUMS_FROM_TOSTRING
public static final Option FLATTENED_ENUMS
SchemaKeyword.TAG_TYPE_STRING
values – derived from their respective constant name.
FLATTENED_ENUMS_FROM_TOSTRING
is disabled but takes priority over SIMPLIFIED_ENUMS
.FLATTENED_ENUMS_FROM_TOSTRING
,
SIMPLIFIED_ENUMS
public static final Option FLATTENED_ENUMS_FROM_TOSTRING
SchemaKeyword.TAG_TYPE_STRING
values – derived from their respective toString()
.
FLATTENED_ENUMS
and SIMPLIFIED_ENUMS
.FLATTENED_ENUMS
,
SIMPLIFIED_ENUMS
public static final Option SIMPLIFIED_OPTIONALS
Optional
instance should be reduced to an object with only three methods.
FLATTENED_OPTIONALS
is disabled.public static final Option FLATTENED_OPTIONALS
Optional
instance should be treated as nullable value of the wrapped type.
SIMPLIFIED_OPTIONALS
.SIMPLIFIED_OPTIONALS
public static final Option VALUES_FROM_CONSTANT_FIELDS
public static final Option PUBLIC_STATIC_FIELDS
static
fields with public visibility should be included.public static final Option PUBLIC_NONSTATIC_FIELDS
static
fields with public visibility should be included.public static final Option NONPUBLIC_STATIC_FIELDS
static
fields with private/package/protected visibility should be included.public static final Option NONPUBLIC_NONSTATIC_FIELDS_WITH_GETTERS
public static final Option NONPUBLIC_NONSTATIC_FIELDS_WITHOUT_GETTERS
public static final Option TRANSIENT_FIELDS
transient
fields should be included.public static final Option STATIC_METHODS
static
should be included.public static final Option VOID_METHODS
public static final Option GETTER_METHODS
public static final Option NONSTATIC_NONVOID_NONGETTER_METHODS
static
, (2) have a specific return value and (3) are not getters, should be included.STATIC_METHODS
,
VOID_METHODS
,
GETTER_METHODS
public static final Option NULLABLE_FIELDS_BY_DEFAULT
public static final Option NULLABLE_METHOD_RETURN_VALUES_BY_DEFAULT
public static final Option MAP_VALUES_AS_ADDITIONAL_PROPERTIES
Map<K, V>
schema's "additionalProperties" should be set to its declared value type V
.public static final Option FORBIDDEN_ADDITIONAL_PROPERTIES_BY_DEFAULT
public static final Option DEFINITIONS_FOR_ALL_OBJECTS
public static final Option DEFINITION_FOR_MAIN_SCHEMA
"$ref": "#"
and assigning a name to it like for all other defined subschemas.
Beware: this only results in a valid schema from SchemaVersion.DRAFT_2019_09
onward. Before that, everything besides "$ref" would be
ignored.
public static final Option INLINE_ALL_SCHEMAS
DEFINITIONS_FOR_ALL_OBJECTS
and DEFINITION_FOR_MAIN_SCHEMA
.
Beware: This will result in an exception being thrown if a single circular reference is being encountered!
public static final Option PLAIN_DEFINITION_KEYS
^[a-zA-Z0-9\.\-_]+$
.public static final Option ALLOF_CLEANUP_AT_THE_END
public static Option[] values()
for (Option c : Option.values()) System.out.println(c);
public static Option valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isOverriding(Option otherOption)
otherOption
- option that may be ignoredCopyright © 2020 VicTools. All rights reserved.