public static String prettyPrint(Node node) { if (node instanceof Element) { return prettyPrint((Element) node); } // TODO: Better print return "Node:" + node.getNodeName(); }
public static String formatElementName(QName elementName) { if (elementName == null) { return "null"; } if (detailedDebugDump) { return PrettyPrinter.prettyPrint(elementName); } else { return elementName.getLocalPart(); } }
public static void display(String title, Object value) { System.out.println(OBJECT_TITLE_OUT_PREFIX + title); System.out.println(PrettyPrinter.prettyPrint(value)); LOGGER.debug(OBJECT_TITLE_LOG_PREFIX + title + "\n" + PrettyPrinter.prettyPrint(value)); }
private String dumpSourceValues(Map<QName, Object> variables) { StringBuilder sb = new StringBuilder(); for (Entry<QName, Object> entry: variables.entrySet()) { sb.append(PrettyPrinter.prettyPrint(entry.getKey())); sb.append("="); sb.append(PrettyPrinter.prettyPrint(entry.getValue())); sb.append("; "); } return sb.toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("TYPE("); sb.append(PrettyPrinter.prettyPrint(type)); sb.append(","); sb.append(filter); sb.append(")"); return sb.toString(); }
public static String prettyPrint(PrismPropertyValue<?> ppv) { String retPPV; try { retPPV = PrettyPrinter.prettyPrint(ppv.getValue()); } catch (Throwable t) { return "N/A"; // rare case e.g. for password-type in resource } return retPPV; }
public static String prettyPrint(PrismContainerValue<?> pcv) { return pcv.getItems().stream() .map(item -> PrettyPrinter.prettyPrint(item)) .collect(Collectors.joining(", ")); }
public static void debugDumpWithLabel(StringBuilder sb, String label, QName val, int indent) { debugDumpLabel(sb, label, indent); sb.append(" "); sb.append(PrettyPrinter.prettyPrint(val)); }
@Override public String toString() { return "ResourceObjectIdentification(" + PrettyPrinter.prettyPrint(objectClassDefinition.getTypeName()) + ": primary=" + primaryIdentifiers + ", secondary=" + secondaryIdentifiers + ")"; }
public String dumpKeyNames() { StringBuilder sb = new StringBuilder(); Iterator<Entry> iterator = subnodes.iterator(); while (iterator.hasNext()) { Entry entry = iterator.next(); sb.append(PrettyPrinter.prettyPrint(entry.getKey())); if (iterator.hasNext()) { sb.append(","); } } return sb.toString(); }
@Override public String toString() { return "ValueParser(DOMe, "+PrettyPrinter.prettyPrint(DOMUtil.getQName(element))+": "+element.getTextContent()+")"; } }
public static String prettyPrint(Item<?, ?> item) { String values = item.getValues().stream() .map(value -> PrettyPrinter.prettyPrint(value)) .collect(Collectors.joining(", ")); return PrettyPrinter.prettyPrint(item.getElementName()) + "={" + values + "}"; }
public void mediumDump(StringBuilder sb) { sb.append("Source ").append(PrettyPrinter.prettyPrint(name)).append(":\n"); sb.append(" old: ").append(getItemOld()).append("\n"); sb.append(" delta: ").append(getDelta()).append("\n"); sb.append(" new: ").append(getItemNew()); }
private String presentAttributeNames() { StringBuilder sb = new StringBuilder(); Iterator<Item<?, ?>> iterator = getAttributes().getItems().iterator(); while (iterator.hasNext()) { sb.append(PrettyPrinter.prettyPrint(iterator.next().getElementName())); if (iterator.hasNext()) { sb.append(", "); } } return sb.toString(); }
@Override public String toString() { return "ValueParser(DOMa, " + PrettyPrinter.prettyPrint(DOMUtil.getQName(attr)) + ": " + attr.getTextContent() + ")"; }
/** * Used in debugDumping items. Does not need to have name in it as item already has it. Does not need * to have class as that is just too much info that is almost anytime pretty obvious anyway. */ @Override public void debugDumpShortToString(StringBuilder sb) { sb.append(PrettyPrinter.prettyPrint(getTypeName())); debugMultiplicity(sb); debugFlags(sb); }
private void dumpSuffix(StringBuilder builder) { appendOriginDump(builder); if (getRawElement() != null) { builder.append(", raw element: "); builder.append(PrettyPrinter.prettyPrint(getRawElement())); } if (getExpression() != null) { builder.append(", expression: "); builder.append(getExpression()); } }
@Override public String toString() { if (getKind() == null) { return getDebugDumpClassName() + "("+PrettyPrinter.prettyPrint(getTypeName())+")"; } else { return getDebugDumpClassName() + "("+getKind()+":"+getIntent()+"="+PrettyPrinter.prettyPrint(getTypeName())+")"; } }
public static void assertIndexed(PrismContainerDefinition<? extends Containerable> containerDef, QName itemQName, Boolean expected) { PrismPropertyDefinition propertyDefinition = containerDef.findPropertyDefinition(ItemName.fromQName(itemQName)); assertEquals("Wrong value of 'indexed' in property '"+PrettyPrinter.prettyPrint(itemQName)+" in "+containerDef, expected, propertyDefinition.isIndexed()); }
public static void assertParentConsistency(Item<?,?> item) { for (PrismValue pval: item.getValues()) { assert pval.getParent() == item : "Wrong parent of "+pval+" in "+PrettyPrinter.prettyPrint(item.getElementName()); if (pval instanceof PrismContainerValue) { assertParentConsistency((PrismContainerValue)pval); } } }