Class Diagnostic

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.daffodil.api.Diagnostic
All Implemented Interfaces:
Serializable

public abstract class Diagnostic extends Exception
Class containing diagnostic information. This does not need to be implemented by the user.
See Also:
  • Constructor Details

    • Diagnostic

      public Diagnostic(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
      Constructor to create Diagnostic
      Parameters:
      message - diagnostic message
      cause - diagnostic cause
      enableSuppression - boolean to enable suppression of warnings
      writableStackTrace - writable stack trace
  • Method Details

    • getMessage

      public abstract String getMessage()
      Get the diagnostic message

      This does not include any additional details about the Diagnostic, such as mode name, schema context, or data location. For a human-readable representation of this diagnostic, including the message and all context information, use toString().

      Overrides:
      getMessage in class Throwable
      Returns:
      diagnostic message in string form
    • getModeName

      public abstract String getModeName()
      Get the diagnostic mode name
      Returns:
      diagnostic mode name in string form
    • toString

      public abstract String toString()
      Get a string containing the mode name, message, schema location, and data location combined into a single string
      Overrides:
      toString in class Throwable
      Returns:
      all diagnostic information as a string
    • getDataLocations

      public abstract List<DataLocation> getDataLocations()
      Get data location information relevant to this diagnostic object.

      For example, this might be a file name, and position within the file.

      Returns:
      list of DataLocation's related to this diagnostic
    • getLocationsInSchemaFiles

      public abstract List<? extends LocationInSchemaFile> getLocationsInSchemaFiles()
      Get schema location information relevant to this diagnostic object.

      For example, this might be a file name of a schema, and position within the schema file.

      Returns:
      list of LocationInSchemaFile's related to this diagnostic.
    • isError

      public abstract boolean isError()
      Determine if a diagnostic object represents an error or something less serious.
      Returns:
      true if it represents an error, false otherwise
    • isValidation

      public abstract boolean isValidation()
      Determine if a diagnostic object represents a validation diagnostic. This could be a validation error or a validation warning depending on isError
      Returns:
      true if it represents a validation diagnostic, false otherwise