public static void printTree(Object [] root, Writer out) { if (null == root) { indentPrintln(out, "null"); return; } Object obj; for (int i = 0; i < root.length; i++) { obj = root[i]; if (null == obj) { indentPrintln(out, "null"); } else { if (obj.getClass().isArray()) { curDepth++; printTree((Object [])obj, out); curDepth--; } else { indentPrintln(out, obj.toString()); } } } }
public DebugUtil() { super(); // Util.parameterNonNull(); this.init(); }
private static void indentPrintln(Logger out, Object toPrint) { StringBuilder builder = new StringBuilder(); String str = (null == toPrint) ? "null" : toPrint.toString(); // handle indentation for (int i = 0; i < curDepth; i++) { builder.append(" "); } builder.append(str + "\n"); if (!(toPrint instanceof String)) { assertSerializability(builder, toPrint); } out.severe(builder.toString()); }
public static void printList(List list, Logger out) { for (Object cur : list) { if (cur instanceof List) { curDepth++; printList((List)cur, out); curDepth--; } else { indentPrintln(out, cur); } } }
public static void printTree(Object [] root, Logger out) { if (null == root) { indentPrintln(out, "null"); return; } Object obj; for (int i = 0; i < root.length; i++) { obj = root[i]; if (null == obj) { indentPrintln(out, "null"); } else { if (obj.getClass().isArray()) { curDepth++; printTree((Object [])obj, out); curDepth--; } else if (obj instanceof List) { printList((List) obj, out); } else { indentPrintln(out, obj); } } } }
/** * Output of printTree() to a PrintStream. * Usage: * DebugUtil.printTree(root, System.out); * * @param root the root component * @param out the PrintStream to write to */ public static void printTree(UIComponent root, PrintStream out) { PrintWriter writer = new PrintWriter(out); printTree(root, writer); writer.flush(); }
public static void simplePrintTree(UIComponent root, String duplicateId, Writer out) { if (null == root) { return; } if (duplicateId.equals(root.getId())) { indentPrintln(out, "+id: " + root.getId() + " <==============="); } else { indentPrintln(out, "+id: " + root.getId()); } indentPrintln(out, " type: " + root.toString()); curDepth++; // print all the facets of this component for (UIComponent uiComponent : root.getFacets().values()) { simplePrintTree(uiComponent, duplicateId, out); } // print all the children of this component for (UIComponent uiComponent : root.getChildren()) { simplePrintTree(uiComponent, duplicateId, out); } curDepth--; }
protected void checkIdUniqueness(FacesContext context, UIComponent component, Set<String> componentIds) throws IllegalStateException { // deal with children/facets that are marked transient. for (Iterator<UIComponent> kids = component.getFacetsAndChildren(); kids.hasNext();) { UIComponent kid = kids.next(); // check for id uniqueness String id = kid.getClientId(context); if (componentIds.add(id)) { checkIdUniqueness(context, kid, componentIds); } else { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, "jsf.duplicate_component_id_error", id); } FastStringWriter writer = new FastStringWriter(128); DebugUtil.simplePrintTree(context.getViewRoot(), id, writer); String message = MessageUtils.getExceptionMessageString( MessageUtils.DUPLICATE_COMPONENT_ID_ERROR_ID, id) + '\n' + writer.toString(); throw new IllegalStateException(message); } } }
out.writeObject(stateToWrite[1]); } catch (Exception e) { DebugUtil.printState((Map)stateToWrite[1], LOGGER); throw new FacesException( "Serialization error. Path to offending instance: "
public static void printTree(Object [] root, Logger out) { if (null == root) { indentPrintln(out, "null"); return; } Object obj; for (int i = 0; i < root.length; i++) { obj = root[i]; if (null == obj) { indentPrintln(out, "null"); } else { if (obj.getClass().isArray()) { curDepth++; printTree((Object [])obj, out); curDepth--; } else if (obj instanceof List) { printList((List) obj, out); } else { indentPrintln(out, obj); } } } }
public static void printTree(UIComponent root, Logger logger, Level level) { StringWriter sw = new StringWriter(); printTree(root, sw); logger.log(level, sw.toString()); }
public static void simplePrintTree(UIComponent root, String duplicateId, Writer out) { if (null == root) { return; } if (duplicateId.equals(root.getClientId())) { indentPrintln(out, "+id: " + root.getId() + " <==============="); } else { indentPrintln(out, "+id: " + root.getId()); } indentPrintln(out, " type: " + root.toString()); curDepth++; // print all the facets of this component for (UIComponent uiComponent : root.getFacets().values()) { simplePrintTree(uiComponent, duplicateId, out); } // print all the children of this component for (UIComponent uiComponent : root.getChildren()) { simplePrintTree(uiComponent, duplicateId, out); } curDepth--; }
public static void printList(List list, Logger out) { for (Object cur : list) { if (cur instanceof List) { curDepth++; printList((List)cur, out); curDepth--; } else { indentPrintln(out, cur); } } }
DebugUtil.simplePrintTree(context.getViewRoot(), id, writer); LOGGER.severe(writer.toString());
out.writeObject(stateToWrite[1]); } catch (Exception e) { DebugUtil.printState((Map)stateToWrite[1], LOGGER); throw new FacesException( "Serialization error. Path to offending instance: "
public static void printTree(Object [] root, Writer out) { if (null == root) { indentPrintln(out, "null"); return; } Object obj; for (int i = 0; i < root.length; i++) { obj = root[i]; if (null == obj) { indentPrintln(out, "null"); } else { if (obj.getClass().isArray()) { curDepth++; printTree((Object [])obj, out); curDepth--; } else { indentPrintln(out, obj.toString()); } } } }
public static void printTree(Object [] root, Logger out) { if (null == root) { indentPrintln(out, "null"); return; } Object obj; for (int i = 0; i < root.length; i++) { obj = root[i]; if (null == obj) { indentPrintln(out, "null"); } else { if (obj.getClass().isArray()) { curDepth++; printTree((Object [])obj, out); curDepth--; } else if (obj instanceof List) { printList((List) obj, out); } else { indentPrintln(out, obj); } } } }
public static void printTree(UIComponent root, Logger logger, Level level) { StringWriter sw = new StringWriter(); printTree(root, sw); logger.log(level, sw.toString()); }
public static void simplePrintTree(UIComponent root, String duplicateId, Writer out) { if (null == root) { return; } if (duplicateId.equals(root.getClientId())) { indentPrintln(out, "+id: " + root.getId() + " <==============="); } else { indentPrintln(out, "+id: " + root.getId()); } indentPrintln(out, " type: " + root.toString()); curDepth++; // print all the facets of this component for (UIComponent uiComponent : root.getFacets().values()) { simplePrintTree(uiComponent, duplicateId, out); } // print all the children of this component for (UIComponent uiComponent : root.getChildren()) { simplePrintTree(uiComponent, duplicateId, out); } curDepth--; }
public static void printList(List list, Logger out) { for (Object cur : list) { if (cur instanceof List) { curDepth++; printList((List)cur, out); curDepth--; } else { indentPrintln(out, cur); } } }