Class XmlTreeRenderer.XmlRenderingConfig

java.lang.Object
net.sourceforge.pmd.util.treeexport.XmlTreeRenderer.XmlRenderingConfig
Enclosing class:
XmlTreeRenderer

public static class XmlTreeRenderer.XmlRenderingConfig extends Object
A strategy to parameterize an XmlTreeRenderer.
  • Constructor Details

    • XmlRenderingConfig

      public XmlRenderingConfig()
  • Method Details

    • handleAttributeFetchException

      protected void handleAttributeFetchException(Attribute attr, Exception e)
      Handle an exception that occurred while fetching the value of an attribute. The default does nothing, it's meant to be overridden if you want to handle it.
      Parameters:
      attr - Attribute for which the fetch failed
      e - Exception that occurred
    • takeAttribute

      protected boolean takeAttribute(Node node, Attribute attribute)
      Returns true if the attribute should be included in the element corresponding to the given node. Subclasses can override this method to filter out some attributes.
      Parameters:
      node - Node owning the attribute
      attribute - Attribute to test
    • lineSeparator

      public XmlTreeRenderer.XmlRenderingConfig lineSeparator(String lineSeparator)
      Sets the string that should be used to separate lines. The default is the platform-specific line separator. The following special values are interpreted specially: CR, CRLF, LF, \r, \r\n and \n. The latter three use literal backslashes and are interpreted like Java escapes. The former three are named aliases for the same.
      Throws:
      NullPointerException - If the argument is null
    • singleQuoteAttributes

      public XmlTreeRenderer.XmlRenderingConfig singleQuoteAttributes(boolean useSingleQuote)
      Sets the delimiters use for attribute values. The default is to use single quotes.
      Parameters:
      useSingleQuote - True for single quotes, false for double quotes
    • renderProlog

      public XmlTreeRenderer.XmlRenderingConfig renderProlog(boolean renderProlog)
      Sets whether to render an XML prolog or not. The default is true.
    • indentWith

      public XmlTreeRenderer.XmlRenderingConfig indentWith(String indentString)
      Sets the string that should be used to indent children elements. The default is four spaces.
      Throws:
      NullPointerException - If the argument is null