String () { if (myImportCollector.isEmpty()) return ""; final StringBuilder buffer = new StringBuilder(); for (GroovyImport anImport : myImportCollector.getAllImports()) { if (anImport instanceof RegularImport) { buffer .append(((RegularImport)anImport).getClassFqn()) .append(':') .append(((RegularImport)anImport).getName()); } else if (anImport instanceof StaticImport) { buffer .append(((StaticImport)anImport).getClassFqn()) .append('.') .append(((StaticImport)anImport).getMemberName()) .append(':') .append(((StaticImport)anImport).getName()); } else if (anImport instanceof GroovyStarImport) { buffer.append(((GroovyStarImport)anImport).getFqn()); } else { LOG.warn("Unsupported import. Class: " + anImport.getClass()); } buffer.append(','); } buffer.deleteCharAt(buffer.length() - 1); return buffer.toString(); }