private static void _init(FacesContext context) throws IOException { if (errorParts == null) { errorParts = _splitTemplate(_getErrorTemplate(context)); } if (debugParts == null) { debugParts = _splitTemplate(_getDebugTemplate(context)); } }
private static void _incrementVisitedFacetCount(UIComponent component) { visitedFacetCount.put(component, _getVisitedFacetCount(component) + 1); }
private static void _prepareExceptionStack(Throwable ex) { if (ex == null) return; // check for getRootCause and getCause-methods if (!_initCausePerReflection(ex, "getRootCause")) { _initCausePerReflection(ex, "getCause"); } _prepareExceptionStack(ex.getCause()); }
private static void debugHtml(Writer writer, FacesContext faces, Throwable e, UIViewRoot view) throws IOException _init(faces); Date now = new Date(); for (int i = 0; i < ERROR_PARTS.length; i++) _writeException(writer, e); _writeComponent(faces, writer, view, _getErrorId(e)); _writeVariables(writer, faces, view); _writeCause(writer, e);
_init(faces); Date now = new Date(); for (int i = 0; i < debugParts.length; i++) _writeComponent(faces, writer, faces.getViewRoot(), null, true); _writeExtendedComponentTree(writer, faces); _writeVariables(writer, faces, faces.getViewRoot());
private static void _writeComponent(FacesContext faces, Writer writer, UIComponent c, List<String> highlightId) throws IOException if (_isText(c)) _writeStart(writer, c, hasChildren, true); writer.write(" - State size:" + stateSize + " bytes"); writer.write("</dt>"); writer.write(entry.getKey()); writer.write("</span>"); _writeComponent(faces, writer, entry.getValue(), highlightId); writer.write("</dd>"); _writeComponent(faces, writer, child, highlightId); writer.write("</dd>"); _writeEnd(writer, c); writer.write("</dt>");
private static void _writeStart(Writer writer, UIComponent c, boolean children, boolean valueExpressionValues) throws IOException { if (_isText(c)) { String str = c.toString().trim(); writer.write(str.replaceAll("<", TS)); } else { writer.write(TS); writer.write(_getName(c)); _writeAttributes(writer, c, valueExpressionValues); if (children) { writer.write('>'); } else { writer.write("/>"); } } }
if (valueExpressionValues && valueExpression != null) _writeAttribute(writer, pd[i].getName(), valueExpression.getExpressionString()); _writeAttribute(writer, pd[i].getName(), str); if (binding != null) _writeAttribute(writer, "binding", binding.getExpressionString()); String location = _getComponentLocation(c); if (location != null) _writeAttribute(writer, "location", location);
private static boolean _initCausePerReflection(Throwable ex, String methodName) { try { Method causeGetter = ex.getClass().getMethod(methodName, (Class[])null); Throwable rootCause = (Throwable)causeGetter.invoke(ex, (Object[])null); return _initCauseIfAvailable(ex, rootCause); } catch (Exception e1) { return false; } }
private static void debugHtml(Writer writer, FacesContext faces, Throwable e, UIViewRoot view) throws IOException _init(faces); Date now = new Date(); for (int i = 0; i < ERROR_PARTS.length; i++) _writeException(writer, e); _writeComponent(faces, writer, view, _getErrorId(e)); _writeVariables(writer, faces, view); _writeCause(writer, e);
_init(faces); Date now = new Date(); for (int i = 0; i < DEBUG_PARTS.length; i++) _writeComponent(faces, writer, faces.getViewRoot(), null); _writeExtendedComponentTree(writer, faces); _writeVariables(writer, faces, faces.getViewRoot());
if (_isText(c)) _writeStart(writer, c, hasChildren, true); writer.write(" - State size:" + stateSize + " bytes"); writer.write("</dt>"); writer.write(entry.getKey()); writer.write("</span>"); _writeComponent(faces, writer, entry.getValue(), highlightId, true); writer.write("</dd>"); _writeComponent(faces, writer, child, highlightId, writeChildren); writer.write("</dd>"); _writeEnd(writer, c); writer.write("</dt>");
private static void _writeStart(Writer writer, UIComponent c, boolean children, boolean valueExpressionValues) throws IOException { if (_isText(c)) { String str = c.toString().trim(); writer.write(str.replaceAll("<", TS)); } else { writer.write(TS); writer.write(_getName(c)); _writeAttributes(writer, c, valueExpressionValues); if (children) { writer.write('>'); } else { writer.write("/>"); } } }
private static void _prepareExceptionStack(Throwable ex) { if (ex == null) return; // check for getRootCause and getCause-methods if (!_initCausePerReflection(ex, "getRootCause")) { _initCausePerReflection(ex, "getCause"); } _prepareExceptionStack(ex.getCause()); }
_writeAttribute(writer, pd[i].getName(), expressionString); _writeAttribute(writer, pd[i].getName(), str); if (binding != null) _writeAttribute(writer, "binding", binding.getExpressionString()); String location = _getComponentLocation(c); if (location != null) _writeAttribute(writer, "location", location);
private static boolean _initCausePerReflection(Throwable ex, String methodName) { try { Method causeGetter = ex.getClass().getMethod(methodName, (Class[])null); Throwable rootCause = (Throwable)causeGetter.invoke(ex, (Object[])null); return _initCauseIfAvailable(ex, rootCause); } catch (Exception e1) { return false; } }
private static void debugHtml(Writer writer, FacesContext faces, UIViewRoot view, Collection<UIComponent> components, Throwable... exs) throws IOException _init(faces); Date now = new Date(); _writeException(writer, e); printed = true; List<String> errorIds = _getErrorId(components, exs); _writeComponent(faces, writer, view, errorIds, true); _writeVariables(writer, faces, view); _writeCause(writer, e); if (iterator != null) if (uiComponent != null) _writeComponent(faces, writer, uiComponent, null, /* writeChildren */false);
_init(faces); Date now = new Date(); for (int i = 0; i < DEBUG_PARTS.length; i++) _writeComponent(faces, writer, faces.getViewRoot(), null); _writeExtendedComponentTree(writer, faces); _writeVariables(writer, faces, faces.getViewRoot());
private static void _writeComponent(FacesContext faces, Writer writer, UIComponent c, List<String> highlightId) throws IOException if (_isText(c)) _writeStart(writer, c, hasChildren, true); writer.write(" - State size:" + stateSize + " bytes"); writer.write("</dt>"); writer.write(entry.getKey()); writer.write("</span>"); _writeComponent(faces, writer, entry.getValue(), highlightId); writer.write("</dd>"); _writeComponent(faces, writer, child, highlightId); writer.write("</dd>"); _writeEnd(writer, c); writer.write("</dt>");