private class Selector implements IJavaElementRequestor { public List<IPackageFragment> pkgFragments; public Selector(String moduleName) { this.pkgFragments = new ArrayList<>(); } @Override public void acceptField(IField field) { // do nothing } @Override public void acceptInitializer(IInitializer initializer) { // do nothing } @Override public void acceptMemberType(IType type) { // do nothing } @Override public void acceptMethod(IMethod method) { // do nothing } @Override public void acceptPackageFragment(IPackageFragment packageFragment) { this.pkgFragments.add(packageFragment);
private class Selector implements IJavaElementRequestor { public List<IPackageFragment> pkgFragments; public Selector(String moduleName) { this.pkgFragments = new ArrayList<>(); } @Override public void acceptField(IField field) { // do nothing } @Override public void acceptInitializer(IInitializer initializer) { // do nothing } @Override public void acceptMemberType(IType type) { // do nothing } @Override public void acceptMethod(IMethod method) { // do nothing } @Override public void acceptPackageFragment(IPackageFragment packageFragment) { this.pkgFragments.add(packageFragment);
public static class Answer { public IType type; AccessRestriction restriction; IClasspathEntry entry; Answer(IType type, AccessRestriction restriction, IClasspathEntry entry) { this.type = type; this.restriction = restriction; this.entry = entry; } public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /* * Returns whether this answer is better than the other awswer. * (accessible is better than discouraged, which is better than * non-accessible) */ public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
public static class Answer { public IType type; AccessRestriction restriction; Answer(IType type, AccessRestriction restriction) { this.type = type; this.restriction = restriction; } public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /* * Returns whether this answer is better than the other awswer. * (accessible is better than discouraged, which is better than * non-accessible) */ public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
public static class Answer { public IType type; AccessRestriction restriction; Answer(IType type, AccessRestriction restriction) { this.type = type; this.restriction = restriction; } public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /* * Returns whether this answer is better than the other awswer. * (accessible is better than discouraged, which is better than * non-accessible) */ public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
public static class Answer { public IType type; AccessRestriction restriction; Answer(IType type, AccessRestriction restriction) { this.type = type; this.restriction = restriction; } public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /* * Returns whether this answer is better than the other awswer. * (accessible is better than discouraged, which is better than * non-accessible) */ public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
public Answer findModule(char[] moduleName) { JavaElementRequestor requestor = new JavaElementRequestor(); seekModule(moduleName, false, requestor); IModuleDescription[] modules = requestor.getModules(); if (modules.length == 0) { try { // FIXME(SHMOD): only considers source modules?? (MODULEPATH container is only experimental) JavaModelManager.getModulePathManager().seekModule(moduleName, false, requestor); modules = requestor.getModules(); } catch (JavaModelException e) { // TODO Auto-generated catch block } } if (modules.length > 0) { // TODO what to do?? return new Answer(modules[0]); } return null; }
public Answer findModule(char[] moduleName) { JavaElementRequestor requestor = new JavaElementRequestor(); seekModule(moduleName, false, requestor); IModuleDescription[] modules = requestor.getModules(); if (modules.length == 0) { try { // FIXME(SHMOD): only considers source modules?? (MODULEPATH container is only experimental) JavaModelManager.getModulePathManager().seekModule(moduleName, false, requestor); modules = requestor.getModules(); } catch (JavaModelException e) { // TODO Auto-generated catch block } } if (modules.length > 0) { // TODO what to do?? return new Answer(modules[0]); } return null; }