[#import] packageName.simpleName [/#import] or [#import] packageName.* [/#import]
where:
The import tag makes the referenced Java type directly available in the template.
You can then use the element using its simple name, rather than having to use a qualified name.
You may also make the whole content of a package directly available using the '*' (star) character.
When an element is referenced in the template contents using a simple name (e.g. MyElement), the element is resolved this way:
import com.mycompany.example.MyElement)import com.mycompany.example.*)A template that won't compile due to an unresolved type:
[#parameters] values : List [/#parameters]
The template can be rewritten to use a qualified name:
[#parameters] values : java.util.List [/#parameters]
[#comment] java.util.List is valid [/#comment]
Or we can introduce an import to keep the simple notation:
[#import]java.util.List[/#import]
[#parameters] values : List [/#parameters]
[#comment] List is resolved to java.util.List [/#comment]