public String toString() { return "JavacScope[env=" + env + ",starImport=" + isStarImportScope() + "]"; } }
public JavacScope getEnclosingScope() { if (env.outer != null && env.outer != env) return new JavacScope(env.outer); else { // synthesize an outermost "star-import" scope return new JavacScope(env) { public boolean isStarImportScope() { return true; } public JavacScope getEnclosingScope() { return null; } public Iterable<? extends Element> getLocalElements() { return env.toplevel.starImportScope.getElements(); } }; } }
private NBScope(JavacScope scope) { super(scope.getEnv()); }
public String toString() { return "JavacScope[env=" + env + ",starImport=" + isStarImportScope() + "]"; } }
public JavacScope getEnclosingScope() { if (env.outer != null && env.outer != env) return new JavacScope(env.outer); else { // synthesize an outermost "star-import" scope return new JavacScope(env) { public boolean isStarImportScope() { return true; } public JavacScope getEnclosingScope() { return null; } public Iterable<? extends Element> getLocalElements() { return env.toplevel.starImportScope.getElements(); } }; } }
/**Checks whether the given scope is in "static" context. */ public boolean isStaticContext(Scope scope) { return Resolve.instance(info.impl.getJavacTask().getContext()).isStatic(((JavacScope)scope).getEnv()); }
public String toString() { return "JavacScope[env=" + env + ",starImport=" + isStarImportScope() + "]"; } }
public JavacScope getEnclosingScope() { if (env.outer != null && env.outer != env) return new JavacScope(env.outer); else { // synthesize an outermost "star-import" scope return new JavacScope(env) { public boolean isStarImportScope() { return true; } public JavacScope getEnclosingScope() { return null; } public Iterable<? extends Element> getLocalElements() { return env.toplevel.starImportScope.getElements(); } }; } }
/**Attribute the given tree in the given context. */ public TypeMirror attributeTree(Tree tree, Scope scope) { if (scope instanceof NBScope && ((NBScope)scope).areAccessibilityChecksDisabled()) { NBResolve.instance(info.impl.getJavacTask().getContext()).disableAccessibilityChecks(); } try { return info.impl.getJavacTask().attributeTree((JCTree) tree, ((JavacScope) scope).getEnv()); } finally { NBResolve.instance(info.impl.getJavacTask().getContext()).restoreAccessbilityChecks(); } }
public String toString() { return "JavacScope[env=" + env + ",starImport=" + isStarImportScope() + "]"; } }
public JavacScope getEnclosingScope() { if (env.outer != null && env.outer != env) return new JavacScope(env.outer); else { // synthesize an outermost "star-import" scope return new JavacScope(env) { public boolean isStarImportScope() { return true; } public JavacScope getEnclosingScope() { return null; } public Iterable<? extends Element> getLocalElements() { return env.toplevel.starImportScope.getElements(); } }; } }
/**Attribute the given tree until the given <code>to</code> tree is reached. * Returns scope valid at point when <code>to</code> is reached. */ public Scope attributeTreeTo(Tree tree, Scope scope, Tree to) { if (scope instanceof NBScope && ((NBScope)scope).areAccessibilityChecksDisabled()) { NBResolve.instance(info.impl.getJavacTask().getContext()).disableAccessibilityChecks(); } try { return info.impl.getJavacTask().attributeTreeTo((JCTree)tree, ((JavacScope)scope).getEnv(), (JCTree)to); } finally { NBResolve.instance(info.impl.getJavacTask().getContext()).restoreAccessbilityChecks(); } }
public boolean equals(Object other) { if (other instanceof JavacScope) { JavacScope s = (JavacScope) other; return (env.equals(s.env) && isStarImportScope() == s.isStarImportScope()); } else return false; }
public JavacScope getScope(TreePath path) { return new JavacScope(getAttrContext(path)); }
public TypeMirror reattributeTree(Tree tree, Scope scope) { Env<AttrContext> env = ((JavacScope)scope).getEnv(); copyInnerClassIndexes(env.tree, tree); if (scope instanceof NBScope && ((NBScope)scope).areAccessibilityChecksDisabled()) { NBResolve.instance(info.impl.getJavacTask().getContext()).disableAccessibilityChecks(); } try { return info.impl.getJavacTask().attributeTree((JCTree)tree, env); } finally { NBResolve.instance(info.impl.getJavacTask().getContext()).restoreAccessbilityChecks(); } }
public boolean equals(Object other) { if (other instanceof JavacScope) { JavacScope s = (JavacScope) other; return (env.equals(s.env) && isStarImportScope() == s.isStarImportScope()); } else return false; }
public JavacScope getScope(TreePath path) { return new JavacScope(getAttrContext(path)); }
public Scope reattributeTreeTo(Tree tree, Scope scope, Tree to) { Env<AttrContext> env = ((JavacScope)scope).getEnv(); copyInnerClassIndexes(env.tree, tree); if (scope instanceof NBScope && ((NBScope)scope).areAccessibilityChecksDisabled()) { NBResolve.instance(info.impl.getJavacTask().getContext()).disableAccessibilityChecks(); } try { return info.impl.getJavacTask().attributeTreeTo((JCTree)tree, env, (JCTree)to); } finally { NBResolve.instance(info.impl.getJavacTask().getContext()).restoreAccessbilityChecks(); } }
public boolean equals(Object other) { if (other instanceof JavacScope) { JavacScope s = (JavacScope) other; return (env.equals(s.env) && isStarImportScope() == s.isStarImportScope()); } else return false; }
public JavacScope getScope(TreePath path) { return new JavacScope(getAttrContext(path)); }