java.lang.Object
com.foursoft.harness.navext.runtime.io.write.xmlmeta.comments.Comments

public class Comments extends Object
Comments allows adding XML-comments to the output file. The comments are linked to JAXB elements and added directly before the xml-element.

Example: If a Root-class exists which is serialized to &lt;Root&gt;&lt;/Root&gt; the following code <pre> XMLWriter&lt;Root&gt; xmlWriter = new XMLWriter&lt;&gt;(Root.class); Root root = new Root(); XMLMeta xmlMeta = new XMLMeta(); Comments comments = new Comments(); comments.put(root, "TestComment"); xmlMeta.setComments(comments); String content = xmlWriter.writeToString(root, xmlMeta); </pre> would result content in containing <pre> &lt;!--TestComment--&gt; &lt;Root&gt;&lt;/Root&gt; </pre>

  • Constructor Details

    • Comments

      public Comments()
  • Method Details