private String extractImportPath(GroovySourceAST t) { return recurseDownImportBranch(getImportPathDotType(t)); }
@Override public void visitImport(GroovySourceAST t, int visit) { if (visit == OPENING_VISIT) { String importTextWithSlashesInsteadOfDots = extractImportPath(t); GroovySourceAST child = t.childOfType(LITERAL_as); if (child != null) { String alias = child.childOfType(DOT).getNextSibling().getText(); child = child.childOfType(DOT); importTextWithSlashesInsteadOfDots = recurseDownImportBranch(child); aliases.put(alias, importTextWithSlashesInsteadOfDots); } importedClassesAndPackages.add(importTextWithSlashesInsteadOfDots); } }
private String recurseDownImportBranch(GroovySourceAST t) { if (t != null) { if (t.getType() == DOT) { GroovySourceAST firstChild = (GroovySourceAST) t.getFirstChild(); GroovySourceAST secondChild = (GroovySourceAST) firstChild.getNextSibling(); return (recurseDownImportBranch(firstChild) + "/" + recurseDownImportBranch(secondChild)); } if (t.getType() == IDENT) { return t.getText(); } if (t.getType() == STAR) { return t.getText(); } } return ""; }
private String extractImportPath(GroovySourceAST t) { return recurseDownImportBranch(getImportPathDotType(t)); }
private String extractImportPath(GroovySourceAST t) { return recurseDownImportBranch(getPackageDotType(t)); }
public void visitImport(GroovySourceAST t, int visit) { if (visit == OPENING_VISIT) { GroovySourceAST child = t.childOfType(GroovyTokenTypes.DOT); if (child == null) { child = t.childOfType(GroovyTokenTypes.IDENT); } String importTextWithSlashesInsteadOfDots = recurseDownImportBranch(child); importedClassesAndPackages.add(importTextWithSlashesInsteadOfDots); } } public String recurseDownImportBranch(GroovySourceAST t) {
private String extractImportPath(GroovySourceAST t) { GroovySourceAST child = t.childOfType(DOT); if (child == null) { child = t.childOfType(IDENT); } return recurseDownImportBranch(child); }
private String extractImportPath(GroovySourceAST t) { GroovySourceAST child = t.childOfType(DOT); if (child == null) { child = t.childOfType(IDENT); } return recurseDownImportBranch(child); }
@Override public void visitImport(GroovySourceAST t, int visit) { if (visit == OPENING_VISIT) { String importTextWithSlashesInsteadOfDots = extractImportPath(t); GroovySourceAST child = t.childOfType(LITERAL_as); if (child != null) { String alias = child.childOfType(DOT).getNextSibling().getText(); child = child.childOfType(DOT); importTextWithSlashesInsteadOfDots = recurseDownImportBranch(child); aliases.put(alias, importTextWithSlashesInsteadOfDots); } importedClassesAndPackages.add(importTextWithSlashesInsteadOfDots); } }
@Override public void visitImport(GroovySourceAST t, int visit) { if (visit == OPENING_VISIT) { String importTextWithSlashesInsteadOfDots = extractImportPath(t); GroovySourceAST child = t.childOfType(LITERAL_as); if (child != null) { String alias = child.childOfType(DOT).getNextSibling().getText(); child = child.childOfType(DOT); importTextWithSlashesInsteadOfDots = recurseDownImportBranch(child); aliases.put(alias, importTextWithSlashesInsteadOfDots); } importedClassesAndPackages.add(importTextWithSlashesInsteadOfDots); } }
private String recurseDownImportBranch(GroovySourceAST t) { if (t != null) { if (t.getType() == DOT) { GroovySourceAST firstChild = (GroovySourceAST) t.getFirstChild(); GroovySourceAST secondChild = (GroovySourceAST) firstChild.getNextSibling(); return (recurseDownImportBranch(firstChild) + "/" + recurseDownImportBranch(secondChild)); } if (t.getType() == IDENT) { return t.getText(); } if (t.getType() == STAR) { return t.getText(); } } return ""; }
public String recurseDownImportBranch(GroovySourceAST t) { if (t != null) { if (t.getType() == GroovyTokenTypes.DOT) { GroovySourceAST firstChild = (GroovySourceAST) t.getFirstChild(); GroovySourceAST secondChild = (GroovySourceAST) firstChild.getNextSibling(); return (recurseDownImportBranch(firstChild) + "/" + recurseDownImportBranch(secondChild)); } if (t.getType() == GroovyTokenTypes.IDENT) { return t.getText(); } if (t.getType() == GroovyTokenTypes.STAR) { return t.getText(); } } return ""; } public void visitExtendsClause(GroovySourceAST t,int visit) {
private String recurseDownImportBranch(GroovySourceAST t) { if (t != null) { if (t.getType() == DOT) { GroovySourceAST firstChild = (GroovySourceAST) t.getFirstChild(); GroovySourceAST secondChild = (GroovySourceAST) firstChild.getNextSibling(); return (recurseDownImportBranch(firstChild) + "/" + recurseDownImportBranch(secondChild)); } if (t.getType() == IDENT) { return t.getText(); } if (t.getType() == STAR) { return t.getText(); } } return ""; }
private String recurseDownImportBranch(GroovySourceAST t) { if (t != null) { if (t.getType() == DOT) { GroovySourceAST firstChild = (GroovySourceAST) t.getFirstChild(); GroovySourceAST secondChild = (GroovySourceAST) firstChild.getNextSibling(); return (recurseDownImportBranch(firstChild) + "/" + recurseDownImportBranch(secondChild)); } if (t.getType() == IDENT) { return t.getText(); } if (t.getType() == STAR) { return t.getText(); } } return ""; }
private String recurseDownImportBranch(GroovySourceAST t) { if (t != null) { if (t.getType() == DOT) { GroovySourceAST firstChild = (GroovySourceAST) t.getFirstChild(); GroovySourceAST secondChild = (GroovySourceAST) firstChild.getNextSibling(); return (recurseDownImportBranch(firstChild) + "/" + recurseDownImportBranch(secondChild)); } if (t.getType() == IDENT) { return t.getText(); } if (t.getType() == STAR) { return t.getText(); } } return ""; }