com.spss.psapi.extensions.common

Class Diagnostic

  • java.lang.Object
    • com.spss.psapi.extensions.common.Diagnostic
  • Direct Known Subclasses:
    ExtensionException.Diagnostic


    public class Diagnostic
    extends java.lang.Object
    Represents a diagnostic message. The message consists of a severity level and a localized message. The valid severity levels are defined by the constants INFORMATION, WARNING and ERROR. Diagnostics can also be created for specific property values.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int ERROR
      Indicates an error message.
      static int INFORMATION
      Indicates an information message.
      static int WARNING
      Indicates a warning message.
    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      protected Diagnostic(int severity, java.lang.String message)
      Creates a Diagnostic instance.
      protected Diagnostic(int severity, java.lang.String property, java.lang.String message)
      Creates a Diagnostic instance.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static Diagnostic error(java.lang.String localizedMessage)
      Creates and returns a new error diagnostic.
      java.lang.String getDetail()
      Returns the message.
      java.lang.String getProperty()
      Returns the name of the property if this is a property diagnostic or null otherwise.
      int getSeverity()
      Returns the severity.
      static Diagnostic information(java.lang.String localizedMessage)
      Creates and returns a new information diagnostic.
      boolean isPropertyDiagnostic()
      Returns true if this diagnostic refers to a specific property.
      static Diagnostic propertyError(java.lang.String property, java.lang.String localizedMessage)
      Creates and returns a new property error diagnostic.
      static Diagnostic propertyInformation(java.lang.String property, java.lang.String localizedMessage)
      Creates and returns a new property information diagnostic.
      static Diagnostic propertyWarning(java.lang.String property, java.lang.String localizedMessage)
      Creates and returns a new property warning diagnostic.
      static Diagnostic warning(java.lang.String localizedMessage)
      Creates and returns a new warning diagnostic.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Diagnostic

        protected Diagnostic(int severity,
                  java.lang.String message)
        Creates a Diagnostic instance.
        Parameters:
        severity - the message severity which must be one of the constants INFORMATION, WARNING or ERROR.
        message - the localized message
      • Diagnostic

        protected Diagnostic(int severity,
                  java.lang.String property,
                  java.lang.String message)
        Creates a Diagnostic instance.
        Parameters:
        severity - the message severity which must be one of the constants INFORMATION, WARNING or ERROR.
        property - the property name
        message - the localized message
    • Method Detail

      • information

        public static Diagnostic information(java.lang.String localizedMessage)
        Creates and returns a new information diagnostic.
        Parameters:
        localizedMessage - the information message
        Returns:
        a new information diagnostic
        See Also:
        warning(String), error(String)
      • warning

        public static Diagnostic warning(java.lang.String localizedMessage)
        Creates and returns a new warning diagnostic.
        Parameters:
        localizedMessage - the warning message
        Returns:
        a new warning diagnostic
        See Also:
        information(String), error(String)
      • error

        public static Diagnostic error(java.lang.String localizedMessage)
        Creates and returns a new error diagnostic.
        Parameters:
        localizedMessage - the error message
        Returns:
        a new error diagnostic
        See Also:
        information(String), warning(String)
      • propertyInformation

        public static Diagnostic propertyInformation(java.lang.String property,
                                     java.lang.String localizedMessage)
        Creates and returns a new property information diagnostic.
        Parameters:
        property - the property name
        localizedMessage - the information message
        Returns:
        a new information diagnostic
        Since:
        PSAPI 17.1
        See Also:
        propertyWarning(String, String), propertyError(String, String)
      • propertyWarning

        public static Diagnostic propertyWarning(java.lang.String property,
                                 java.lang.String localizedMessage)
        Creates and returns a new property warning diagnostic.
        Parameters:
        property - the property name
        localizedMessage - the warning message
        Returns:
        a new warning diagnostic
        Since:
        PSAPI 17.1
        See Also:
        propertyInformation(String, String), propertyError(String, String)
      • getSeverity

        public int getSeverity()
        Returns the severity. The severity is one of the constants INFORMATION, WARNING or ERROR.
        Returns:
        severity
        See Also:
        INFORMATION, WARNING, ERROR
      • getDetail

        public java.lang.String getDetail()
        Returns the message.
        Returns:
        the message
      • isPropertyDiagnostic

        public boolean isPropertyDiagnostic()
        Returns true if this diagnostic refers to a specific property.
        Returns:
        true if this diagnostic refers to a specific property
        Since:
        PSAPI 17.1
        See Also:
        getProperty()
      • getProperty

        public java.lang.String getProperty()
        Returns the name of the property if this is a property diagnostic or null otherwise.
        Returns:
        the property name or null
        Since:
        PSAPI 17.1
        See Also:
        isPropertyDiagnostic()

Copyright © 2014 Integral Solutions Ltd. All Rights Reserved.