Enum SchemaVersion
- java.lang.Object
-
- java.lang.Enum<SchemaVersion>
-
- io.openapiprocessor.jsonschema.schema.SchemaVersion
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SchemaVersion>
public enum SchemaVersion extends java.lang.Enum<SchemaVersion>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description Draft201909Draft202012Draft4Draft6Draft7
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IdProvidergetIdProvider()@Nullable KeywordgetKeyword(java.lang.String name)static SchemaVersiongetLatest()java.net.URIgetSchemaUri()static @Nullable SchemaVersiongetVersion(java.net.URI schemaUri)try to detect schema version.static SchemaVersiongetVersion(java.net.URI uri, SchemaVersion fallback)try to detect schema version.booleanisApplicatorVocabulary(java.net.URI candidate)booleanisBefore201909()booleanisBefore202012()booleanisContentVocabulary(java.net.URI candidate)booleanisCoreVocabulary(java.net.URI candidate)booleanisFormatAnnotationVocabulary(java.net.URI candidate)booleanisFormatAssertionVocabulary(java.net.URI candidate)booleanisLaterOrEqualTo201909()booleanisMetaDataVocabulary(java.net.URI candidate)booleanisValidationVocabulary(java.net.URI candidate)booleanvalidatesRefSiblings()static SchemaVersionvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static SchemaVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
Draft202012
public static final SchemaVersion Draft202012
-
Draft201909
public static final SchemaVersion Draft201909
-
Draft7
public static final SchemaVersion Draft7
-
Draft6
public static final SchemaVersion Draft6
-
Draft4
public static final SchemaVersion Draft4
-
-
Method Detail
-
values
public static SchemaVersion[] 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 (SchemaVersion c : SchemaVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SchemaVersion valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getLatest
public static SchemaVersion getLatest()
-
getVersion
public static @Nullable SchemaVersion getVersion(java.net.URI schemaUri)
try to detect schema version. IfschemaUridoes not represent a known json schema draft it returns null.- Parameters:
schemaUri- a meta schema uri- Returns:
- the detected schema version or null
-
getVersion
public static SchemaVersion getVersion(java.net.URI uri, SchemaVersion fallback)
try to detect schema version. Ifuridoes not represent a known json schema draft it returns the fallback schema version.- Parameters:
uri- current scopefallback- fallback version- Returns:
- the detected schema version or the latest version
-
getSchemaUri
public java.net.URI getSchemaUri()
-
getKeyword
public @Nullable Keyword getKeyword(java.lang.String name)
-
getIdProvider
public IdProvider getIdProvider()
-
validatesRefSiblings
public boolean validatesRefSiblings()
-
isLaterOrEqualTo201909
public boolean isLaterOrEqualTo201909()
-
isBefore202012
public boolean isBefore202012()
-
isBefore201909
public boolean isBefore201909()
-
isApplicatorVocabulary
public boolean isApplicatorVocabulary(java.net.URI candidate)
-
isContentVocabulary
public boolean isContentVocabulary(java.net.URI candidate)
-
isCoreVocabulary
public boolean isCoreVocabulary(java.net.URI candidate)
-
isFormatAnnotationVocabulary
public boolean isFormatAnnotationVocabulary(java.net.URI candidate)
-
isFormatAssertionVocabulary
public boolean isFormatAssertionVocabulary(java.net.URI candidate)
-
isMetaDataVocabulary
public boolean isMetaDataVocabulary(java.net.URI candidate)
-
isValidationVocabulary
public boolean isValidationVocabulary(java.net.URI candidate)
-
-