Top Constructors Methods
org.jruby.api

public Class Warn

extends Object
Class Inheritance
Imports
org.jruby.common.RubyWarnings, org.jruby.runtime.ThreadContext

Constructor Summary

AccessConstructor and Description
public
Warn()

Method Summary

Modifier and TypeMethod and Description
public static void
warn(ThreadContext context, String message)

public static void
warn(ThreadContext
the current context
context
,
String
the filename for the warning
fileName
,
int
the line number for the warning
lineNumber
,
String
to be displayed as a warning
message
)

Produce a non-verbose warning with the specified file, line, and message.

public static void
warnDeprecated(ThreadContext
the current context
context
,
String
to be displayed as a warning
message
)

Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)

public static void
warnDeprecatedForRemoval(ThreadContext
the current context
context
,
String
to be displayed as a warning
message
,
String
the version at which this deprecated feature will be removed
version
)
Deprecated since 10.0.

Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)

public static void
warnDeprecatedForRemovalAlternate(ThreadContext
the current context
context
,
String
to be displayed as a warning
message
,
String
the version at which this deprecated feature will be removed
version
,
String
the alternate feature that should be used instead
alternate
)

Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)

public static void
warnExperimental(ThreadContext
the current context
context
,
String
to be displayed as a warning
message
)

Produce a warning if experimental is set (e.g. Warning[:experimental] = true)

public static void
warning(ThreadContext context, String message)

public static void
warningDeprecated(ThreadContext
the current context
context
,
String
to be displayed as a warning
message
)

Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true) and in verbose mode.

public static void
warnPerformance(ThreadContext
the current context
context
,
String
to be displayed as a warning
message
)

Produce a warning if performance is set (e.g. Warning[:performance] = true)

public static void
warnReservedName(ThreadContext
the current context
context
,
String
the reserved name
name
,
String
the version the name will be created in
version
)

Produce a warning for reserved constants that will be used by the Ruby language in a later version.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Warnback to summary
public Warn()

Method Detail

warnback to summary
public static void warn(ThreadContext context, String message)
warnback to summary
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:ThreadContext

the current context

fileName:String

the filename for the warning

lineNumber:int

the line number for the warning

message:String

to be displayed as a warning

warnDeprecatedback to summary
public static void warnDeprecated(ThreadContext context, String message)

Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)

Parameters
context:ThreadContext

the current context

message:String

to be displayed as a warning

warnDeprecatedForRemovalback to summary
public static void warnDeprecatedForRemoval(ThreadContext context, String message, String version)

Deprecated

since 10.0.

Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)

Parameters
context:ThreadContext

the current context

message:String

to be displayed as a warning

version:String

the version at which this deprecated feature will be removed

Annotations
@Deprecated
since:10.0
warnDeprecatedForRemovalAlternateback to summary
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:ThreadContext

the current context

message:String

to be displayed as a warning

version:String

the version at which this deprecated feature will be removed

alternate:String

the alternate feature that should be used instead

warnExperimentalback to summary
public static void warnExperimental(ThreadContext context, String message)

Produce a warning if experimental is set (e.g. Warning[:experimental] = true)

Parameters
context:ThreadContext

the current context

message:String

to be displayed as a warning

warningback to summary
public static void warning(ThreadContext context, String message)
warningDeprecatedback to summary
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:ThreadContext

the current context

message:String

to be displayed as a warning

warnPerformanceback to summary
public static void warnPerformance(ThreadContext context, String message)

Produce a warning if performance is set (e.g. Warning[:performance] = true)

Parameters
context:ThreadContext

the current context

message:String

to be displayed as a warning

warnReservedNameback to summary
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:ThreadContext

the current context

name:String

the reserved name

version:String

the version the name will be created in