Package dev.omnist.schema
Class SchemaException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
dev.omnist.schema.SchemaException
- All Implemented Interfaces:
Serializable
Thrown when a programmatically built schema violates a well-formedness rule of
omnist-spec section 3.3 that is enforced at construction.
Two codes are raised here:
schema.invalid-name(S-8): a record name, root name orType.Reftarget does not match[A-Za-z_][A-Za-z0-9_]*. The path is always"$"; the offending name appears in the message only, because it may be malformed.schema.invalid-label(S-22): a field label does not encode to valid UTF-8 (in Java, a lone UTF-16 surrogate). The path is the name of the record holding the field; the label is never put in the path.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaException(String code, String path, String message) Constructs a schema well-formedness exception. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SchemaException
Constructs a schema well-formedness exception.- Parameters:
code- machine-readable error code, e.g.schema.invalid-labelpath- the schema path of the violation ("$"or a record name)message- human-readable description
-
-
Method Details
-
getCode
Returns the machine-readable error code.- Returns:
- the error code
-
getPath
Returns the schema path where the violation was detected.- Returns:
- the path
-