Enum SchemaKeyword
- java.lang.Object
-
- java.lang.Enum<SchemaKeyword>
-
- com.github.victools.jsonschema.generator.SchemaKeyword
-
- All Implemented Interfaces:
Serializable
,Comparable<SchemaKeyword>
public enum SchemaKeyword extends Enum<SchemaKeyword>
JSON Schema properties and their values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemaKeyword.SchemaType
Values of theTAG_TYPE
.static class
SchemaKeyword.TagContent
Type of content/values to be expected under a schema tag.
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
forVersion(SchemaVersion version)
Provide the appropriate tag name/value, considering the specified schema version.List<SchemaKeyword.SchemaType>
getImpliedTypes()
Determine which (if any) specificTAG_TYPE
values this keyword implies.static Map<String,SchemaKeyword>
getReverseTagMap(SchemaVersion version, Predicate<SchemaKeyword> filter)
Provide a map over all keywords, that represent a schema tag/property, i.e., not a value.boolean
supportsContentType(SchemaKeyword.TagContent contentType)
Indicate whether the given kind of values can be expected under this keyword (if it represents a tag).static SchemaKeyword
valueOf(String name)
Returns the enum constant of this type with the specified name.static SchemaKeyword[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TAG_SCHEMA
public static final SchemaKeyword TAG_SCHEMA
-
TAG_SCHEMA_VALUE
public static final SchemaKeyword TAG_SCHEMA_VALUE
-
TAG_ID
public static final SchemaKeyword TAG_ID
-
TAG_ANCHOR
public static final SchemaKeyword TAG_ANCHOR
Beware that this keyword was only introduced inSchemaVersion.DRAFT_2019_09
.
-
TAG_DEFINITIONS
public static final SchemaKeyword TAG_DEFINITIONS
-
TAG_REF
public static final SchemaKeyword TAG_REF
BeforeSchemaVersion.DRAFT_2019_09
all other properties in the same sub-schema besides this one were ignored.
-
TAG_REF_MAIN
public static final SchemaKeyword TAG_REF_MAIN
-
TAG_REF_PREFIX
@Deprecated public static final SchemaKeyword TAG_REF_PREFIX
Deprecated.is now implicitly created based onTAG_DEFINITIONS
or an explicit alternative definitions pathCommon prefix of all standardTAG_REF
values.
-
TAG_TYPE
public static final SchemaKeyword TAG_TYPE
-
TAG_TYPE_NULL
public static final SchemaKeyword TAG_TYPE_NULL
-
TAG_TYPE_ARRAY
public static final SchemaKeyword TAG_TYPE_ARRAY
-
TAG_TYPE_OBJECT
public static final SchemaKeyword TAG_TYPE_OBJECT
-
TAG_TYPE_BOOLEAN
public static final SchemaKeyword TAG_TYPE_BOOLEAN
-
TAG_TYPE_STRING
public static final SchemaKeyword TAG_TYPE_STRING
-
TAG_TYPE_INTEGER
public static final SchemaKeyword TAG_TYPE_INTEGER
-
TAG_TYPE_NUMBER
public static final SchemaKeyword TAG_TYPE_NUMBER
-
TAG_PROPERTIES
public static final SchemaKeyword TAG_PROPERTIES
-
TAG_UNEVALUATED_PROPERTIES
public static final SchemaKeyword TAG_UNEVALUATED_PROPERTIES
Beware that this keyword was only introduced inSchemaVersion.DRAFT_2019_09
.
-
TAG_ITEMS
public static final SchemaKeyword TAG_ITEMS
-
TAG_PREFIX_ITEMS
public static final SchemaKeyword TAG_PREFIX_ITEMS
Beware that this keyword was only introduced inSchemaVersion.DRAFT_2019_09
.
-
TAG_UNEVALUATED_ITEMS
public static final SchemaKeyword TAG_UNEVALUATED_ITEMS
Beware that this keyword was only introduced inSchemaVersion.DRAFT_2019_09
.
-
TAG_REQUIRED
public static final SchemaKeyword TAG_REQUIRED
-
TAG_DEPENDENT_SCHEMAS
public static final SchemaKeyword TAG_DEPENDENT_SCHEMAS
Prior toSchemaVersion.DRAFT_2019_09
, this had the same name asTAG_DEPENDENT_REQUIRED
.
-
TAG_DEPENDENT_REQUIRED
public static final SchemaKeyword TAG_DEPENDENT_REQUIRED
Prior toSchemaVersion.DRAFT_2019_09
, this had the same name asTAG_DEPENDENT_SCHEMAS
.
-
TAG_ADDITIONAL_PROPERTIES
public static final SchemaKeyword TAG_ADDITIONAL_PROPERTIES
-
TAG_PATTERN_PROPERTIES
public static final SchemaKeyword TAG_PATTERN_PROPERTIES
-
TAG_PROPERTIES_MIN
public static final SchemaKeyword TAG_PROPERTIES_MIN
-
TAG_PROPERTIES_MAX
public static final SchemaKeyword TAG_PROPERTIES_MAX
-
TAG_ALLOF
public static final SchemaKeyword TAG_ALLOF
-
TAG_ANYOF
public static final SchemaKeyword TAG_ANYOF
-
TAG_ONEOF
public static final SchemaKeyword TAG_ONEOF
-
TAG_NOT
public static final SchemaKeyword TAG_NOT
-
TAG_TITLE
public static final SchemaKeyword TAG_TITLE
-
TAG_DESCRIPTION
public static final SchemaKeyword TAG_DESCRIPTION
-
TAG_CONST
public static final SchemaKeyword TAG_CONST
-
TAG_ENUM
public static final SchemaKeyword TAG_ENUM
-
TAG_DEFAULT
public static final SchemaKeyword TAG_DEFAULT
-
TAG_READ_ONLY
public static final SchemaKeyword TAG_READ_ONLY
Beware that this keyword was only introduced inSchemaVersion.DRAFT_7
.
-
TAG_WRITE_ONLY
public static final SchemaKeyword TAG_WRITE_ONLY
Beware that this keyword was only introduced inSchemaVersion.DRAFT_7
.
-
TAG_LENGTH_MIN
public static final SchemaKeyword TAG_LENGTH_MIN
-
TAG_LENGTH_MAX
public static final SchemaKeyword TAG_LENGTH_MAX
-
TAG_FORMAT
public static final SchemaKeyword TAG_FORMAT
-
TAG_PATTERN
public static final SchemaKeyword TAG_PATTERN
-
TAG_MINIMUM
public static final SchemaKeyword TAG_MINIMUM
-
TAG_MINIMUM_EXCLUSIVE
public static final SchemaKeyword TAG_MINIMUM_EXCLUSIVE
-
TAG_MAXIMUM
public static final SchemaKeyword TAG_MAXIMUM
-
TAG_MAXIMUM_EXCLUSIVE
public static final SchemaKeyword TAG_MAXIMUM_EXCLUSIVE
-
TAG_MULTIPLE_OF
public static final SchemaKeyword TAG_MULTIPLE_OF
-
TAG_ITEMS_MIN
public static final SchemaKeyword TAG_ITEMS_MIN
-
TAG_ITEMS_MAX
public static final SchemaKeyword TAG_ITEMS_MAX
-
TAG_ITEMS_UNIQUE
public static final SchemaKeyword TAG_ITEMS_UNIQUE
-
TAG_IF
public static final SchemaKeyword TAG_IF
Beware that this keyword was only introduced inSchemaVersion.DRAFT_7
.
-
TAG_THEN
public static final SchemaKeyword TAG_THEN
Beware that this keyword was only introduced inSchemaVersion.DRAFT_7
.
-
TAG_ELSE
public static final SchemaKeyword TAG_ELSE
Beware that this keyword was only introduced inSchemaVersion.DRAFT_7
.
-
-
Method Detail
-
values
public static SchemaKeyword[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SchemaKeyword c : SchemaKeyword.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SchemaKeyword valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
forVersion
public String forVersion(SchemaVersion version)
Provide the appropriate tag name/value, considering the specified schema version.- Parameters:
version
- applicable JSON Schema version- Returns:
- corresponding tag name/value for this keyword in the indicated JSON Schema version
-
getImpliedTypes
public List<SchemaKeyword.SchemaType> getImpliedTypes()
Determine which (if any) specificTAG_TYPE
values this keyword implies.- Returns:
- implied type values or an empty list if this keyword is not type specific
-
supportsContentType
public boolean supportsContentType(SchemaKeyword.TagContent contentType)
Indicate whether the given kind of values can be expected under this keyword (if it represents a tag). Returns always false for values.- Parameters:
contentType
- type of content/values to be expected under a schema tag- Returns:
- whether the given tag content type is supported by this keyword
-
getReverseTagMap
public static Map<String,SchemaKeyword> getReverseTagMap(SchemaVersion version, Predicate<SchemaKeyword> filter)
Provide a map over all keywords, that represent a schema tag/property, i.e., not a value.- Parameters:
version
- schema draft version to look-up keyword forfilter
- additional tag filter to apply- Returns:
- mapping of schema tag/property name to its corresponding tag
-
-