Class SchemaException

All Implemented Interfaces:
Serializable

public class SchemaException extends IllegalArgumentException
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 or Type.Ref target 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 Details

    • SchemaException

      public SchemaException(String code, String path, String message)
      Constructs a schema well-formedness exception.
      Parameters:
      code - machine-readable error code, e.g. schema.invalid-label
      path - the schema path of the violation ("$" or a record name)
      message - human-readable description
  • Method Details

    • getCode

      public String getCode()
      Returns the machine-readable error code.
      Returns:
      the error code
    • getPath

      public String getPath()
      Returns the schema path where the violation was detected.
      Returns:
      the path