Package org.jruby.api

Class Warn

java.lang.Object
org.jruby.api.Warn

public class Warn extends Object
  • Constructor Details

    • Warn

      public Warn()
  • Method Details

    • warn

      public static void warn(ThreadContext context, String message)
    • warnDeprecated

      public static void warnDeprecated(ThreadContext context, String message)
      Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)
      Parameters:
      context - the current context
      message - to be displayed as a warning
    • warnDeprecatedForRemoval

      @Deprecated(since="10.0") public static void warnDeprecatedForRemoval(ThreadContext context, String message, String version)
      Deprecated.
      Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)
      Parameters:
      context - the current context
      message - to be displayed as a warning
      version - the version at which this deprecated feature will be removed
    • warnDeprecatedForRemovalAlternate

      public static void warnDeprecatedForRemovalAlternate(ThreadContext context, String message, String version, String alternate)
      Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)
      Parameters:
      context - the current context
      message - to be displayed as a warning
      version - the version at which this deprecated feature will be removed
      alternate - the alternate feature that should be used instead
    • warnReservedName

      public static void warnReservedName(ThreadContext context, String name, String version)
      Produce a warning for reserved constants that will be used by the Ruby language in a later version. This only works if deprecation warnings are enabled.
      Parameters:
      context - the current context
      name - the reserved name
      version - the version the name will be created in
    • warning

      public static void warning(ThreadContext context, String message)
    • warningDeprecated

      public static void warningDeprecated(ThreadContext context, String message)
      Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true) and in verbose mode.
      Parameters:
      context - the current context
      message - to be displayed as a warning
    • warnExperimental

      public static void warnExperimental(ThreadContext context, String message)
      Produce a warning if experimental is set (e.g. Warning[:experimental] = true)
      Parameters:
      context - the current context
      message - to be displayed as a warning
    • warnPerformance

      public static void warnPerformance(ThreadContext context, String message)
      Produce a warning if performance is set (e.g. Warning[:performance] = true)
      Parameters:
      context - the current context
      message - to be displayed as a warning
    • warn

      public static void warn(ThreadContext context, String fileName, int lineNumber, String message)
      Produce a non-verbose warning with the specified file, line, and message.
      Parameters:
      context - the current context
      fileName - the filename for the warning
      lineNumber - the line number for the warning
      message - to be displayed as a warning