10.2. Import Declarations

An import declaration allows a named type or a static member to be referred to by a simple name instead of a fully qualified name. The XL programming language defines four kinds of import declarations:

Import Declarations
[8]ImportDeclaration::=SingleTypeImportDeclaration | TypeImportOnDemandDeclaration | SingleStaticImportDeclaration | StaticImportOnDemandDeclaration  
[9]SingleTypeImportDeclaration::=import Name ';'  
[10]TypeImportOnDemandDeclaration::=import Name '.' '*' ';'  
[11]SingleStaticImportDeclaration::=import static Name '.' Identifier ';'  
[12]StaticImportOnDemandDeclaration::=import static Name '.' '*' ';'  

The first two kinds, single-type-import and type-import-on-demand declarations, are already known from the Java programming language. Thus, they are not explained here. The last two kinds, single-static-import and static-import-on-demand declarations, have been defined in the Java Language Specification, Third Edition, and are defined for the XL programming language, too.

A single-static-import declaration imports all accessible static members with the given name from the given type. For the details see the Java Language Specification, Third Edition.

A static-import-on-demand declaration imports all accessible static members declared in the given type as needed. For the details see the Java Language Specification, Third Edition.