|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.factory.IlrLanguageSupport
ilog.rules.bom
package.
public class IlrLanguageSupport
This class defines some utility methods that are used by the rule
language. This class is deprecated because it uses directly Java Reflection
objects. It has no direct replacement although the API of the
ilog.rules.bom
package may provide alternative methods.
Method Summary | |
---|---|
static Class |
getPrimitiveType(Class clazz)
Deprecated. Finds the primitive class for a class. |
static Class |
getPublicClass(Class clazz)
Deprecated. Finds the closest public super class for a given class. |
static Class |
getWrappingType(Class clazz)
Deprecated. Finds the wrapper class for a primitive class. |
static boolean |
isApplicable(Class param,
Class argument)
Deprecated. Checks the applicability of an argument for a method or constructor call. |
static boolean |
isAssignable(Class leftType,
Class rightType,
Integer rightValue)
Deprecated. Checks whether an expression of a certain type can be assigned a value of another type, as defined in the Java Language Specification (Assignment Conversion 5.2). |
static boolean |
isCastable(Class resultType,
Class initialType)
Deprecated. Checks whether a cast is permitted. |
static boolean |
isNumber(Class type)
Deprecated. Checks whether a Java class is a primitive numeric type. |
static boolean |
isPublic(Class clazz)
Deprecated. Checks whether a Java class is a public class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isNumber(Class type)
byte
, short
, int
,
long
, float
, double
.
type
- The Java class to be checked.
true
if the passed Java class is a primitive
numeric type, and false
otherwise.public static boolean isPublic(Class clazz)
clazz
- The Java class to be checked.
true
if the passed Java class is public,
and false
otherwise.public static Class getPublicClass(Class clazz)
clazz
- A Java class.public static Class getWrappingType(Class clazz)
public static Class getPrimitiveType(Class clazz)
public static boolean isApplicable(Class param, Class argument)
param
is the class of the parameter defined in
the method or constructor, and argument
is the actual
type of the passed argument.
This method takes care of possible conversions, as defined in the
Java language specification (15.11.2).
param
- The type of the parameter. This argument
should not be null
.argument
- The type of the passed argument. By
convention, if this is null
, the passed argument
is assumed to be null
, and thus can be converted to any
non primitive type.
true
if the argument is applicable to the
parameter.public static boolean isAssignable(Class leftType, Class rightType, Integer rightValue)
leftType
is the type of the left-hand side expression,
and rightType
is the type of the right-hand expression.
As defined in the Java language, if leftType
is either
byte
, short
or char
, and
rightType
is int
, the third argument
represents the value of the constant int
expression and
is used to determine whether it is representable by the left type.
In that case, the narrowing conversion is applied and the method
returns true
.
In all the other cases, the third argument is not used, and thus
it can be null
.
public static boolean isCastable(Class resultType, Class initialType)
initialType
is the type of the expression,
resultType
is the type to which the expression is
casted. By convention, if initialType
is null
,
it represents a cast on the null
object.
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |