| Reference > Rule Languages > ILOG Rule Language > IRL Keywords > import |
import |
PREVIOUS NEXT |
This statement is used to import a Java class or package into a rule file. This keyword is used at the top level of the ruleset.
import [packageName.] className |packageName.*;
The import declarations must be the first statements in a rule file. Import statements are not mandatory, but when present, they are always placed at the beginning of the rule file, before the ruleset header. The import statement indicates to ILOG JRules which Java classes may be used in the ruleset. Once imported, the class or package is accessible from the rules. The scope of the import declarations is the ruleset file.
It is possible to import a specific class or an entire package.
There are several Java classes that are implicitly imported. The following Java classes are automatically added by the rule interpreter:
importjava.lang.*;importilog.rules.engine.*;
Thus, it is not necessary to import classes of these packages explicitly.
import java.util.*; import userPackage.UserClass;
The following packages are automatically imported:
java.lang.*; ilog.rules.engine.*;
Here are some examples of class names that may be used as a result of the above two imports:
Class Name |
Qualified Class Name |
|---|---|
Vector | java.util.Vector |
java.util.Vector | java.util.Vector |
UserClass | userPackage.UseClass |
Number | java.lang.Number |
IlrRule | ilog.rules.engine.IlrRule |
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |