{@inheritDoc}
(final String indent, final boolean tagBefore, final PrintWriter printWriter)
| 347 | * {@inheritDoc} |
| 348 | */ |
| 349 | @Override |
| 350 | protected boolean printXml(final String indent, final boolean tagBefore, final PrintWriter printWriter) { |
| 351 | final boolean hasChildren = getFirstChild() != null; |
| 352 | |
| 353 | if (tagBefore) { |
| 354 | printWriter.print("\r\n"); |
| 355 | printWriter.print(indent); |
| 356 | } |
| 357 | |
| 358 | printWriter.print('<'); |
| 359 | printOpeningTagContentAsXml(printWriter); |
| 360 | |
| 361 | if (hasChildren) { |
| 362 | printWriter.print(">"); |
| 363 | final boolean tag = printChildrenAsXml(indent, true, printWriter); |
| 364 | if (tag) { |
| 365 | printWriter.print("\r\n"); |
| 366 | printWriter.print(indent); |
| 367 | } |
| 368 | printWriter.print("</"); |
| 369 | printWriter.print(getTagName()); |
| 370 | printWriter.print(">"); |
| 371 | } |
| 372 | else if (isEmptyXmlTagExpanded()) { |
| 373 | printWriter.print("></"); |
| 374 | printWriter.print(getTagName()); |
| 375 | printWriter.print(">"); |
| 376 | } |
| 377 | else { |
| 378 | printWriter.print("/>"); |
| 379 | } |
| 380 | |
| 381 | return true; |
| 382 | } |
| 383 | |
| 384 | /** |
| 385 | * Indicates if a node without children should be written in expanded form as XML |
nothing calls this directly
no test coverage detected