private ImportsParser() {
}
public static Imports parseImports(final String content) {
Imports imports = new Imports();
if (content == null || content.trim().equals("")) {
return imports;
} else {
final String[] lines = content.split("\\n");
for (int i = 0; i < lines.length; i++) {
String line = lines[i].trim();
if (!line.equals("") && !line.startsWith("#")) {
if (line.startsWith("import")) {
line = line.substring(6).trim();
if (line.endsWith(";")) {
line = line.substring(0, line.length() - 1);
}
imports.addImport(new Import(line));
}
}
}
return imports;