Does CodeModel support importing classes from unspecified packages?

I want to create a file containing a reference to the class, not knowing what package it really has.

eg. user supplies

import foo.*
import blah.*

Button("press me")

and i need to generate

import foo.*;
import blah.*;

public class MyWindow extends Window {
    public MyWindow() {
        Button button = new Button();
        button.setLabel("press me");
    }
}

A class Buttoncan be in any package. Is this script supported by CodeModel? Examples in CodeModel Help needed to correctly assign singleton.getinstance () and the Java API to generate Java source files specify full package names for classes, and viewing JavaDoc did not help.

+3
source share

Source: https://habr.com/ru/post/1796468/


All Articles