void printFullScopeImpl(Scope scope) { indent(); out.println(scope.getClass().getName()); printSymbol("owner", scope.owner, Details.SUMMARY); if (SCOPE_IMPL_CLASS.equals(scope.getClass().getName())) { printScope("next", (Scope) getField(scope, scope.getClass(), "next"), Details.SUMMARY); printObject("shared", getField(scope, scope.getClass(), "shared"), Details.SUMMARY); Object[] table = (Object[]) getField(scope, scope.getClass(), "table"); for (int i = 0; i < table.length; i++) { if (i > 0) out.print(", "); else indent(); out.print(i + ":" + entryToString(table[i], table, false)); } out.println(); } else if (FILTER_SCOPE_CLASS.equals(scope.getClass().getName())) { printScope("origin", (Scope) getField(scope, scope.getClass(), "origin"), Details.FULL); } else if (scope instanceof CompoundScope) { printList("delegates", (List<?>) getField(scope, CompoundScope.class, "subScopes")); } else { for (Symbol sym : scope.getSymbols()) { printSymbol(sym.name.toString(), sym, Details.SUMMARY); } } }
protected void printObject(String label, Object item, Details details) { if (item == null) { printNull(label); } else if (item instanceof Attribute) { printAttribute(label, (Attribute) item); } else if (item instanceof Symbol) { printSymbol(label, (Symbol) item, details); } else if (item instanceof Type) { printType(label, (Type) item, details); } else if (item instanceof JCTree) { printTree(label, (JCTree) item); } else if (item instanceof DocTree) { printDocTree(label, (DocTree) item); } else if (item instanceof List) { printList(label, (List) item); } else if (item instanceof Name) { printName(label, (Name) item); } else if (item instanceof Scope) { printScope(label, (Scope) item); } else { printString(label, String.valueOf(item)); } }
public void printScope(String label, Scope scope) { printScope(label, scope, Details.FULL); }