Class XmlTreeRenderer.XmlRenderingConfig
java.lang.Object
net.sourceforge.pmd.util.treeexport.XmlTreeRenderer.XmlRenderingConfig
- Enclosing class:
XmlTreeRenderer
A strategy to parameterize an
XmlTreeRenderer.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidHandle an exception that occurred while fetching the value of an attribute.indentWith(String indentString) Sets the string that should be used to indent children elements.lineSeparator(String lineSeparator) Sets the string that should be used to separate lines.renderProlog(boolean renderProlog) Sets whether to render an XML prolog or not.singleQuoteAttributes(boolean useSingleQuote) Sets the delimiters use for attribute values.protected booleantakeAttribute(Node node, Attribute attribute) Returns true if the attribute should be included in the element corresponding to the given node.
-
Constructor Details
-
XmlRenderingConfig
public XmlRenderingConfig()
-
-
Method Details
-
handleAttributeFetchException
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 failede- Exception that occurred
-
takeAttribute
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 attributeattribute- Attribute to test
-
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\nand\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
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
Sets whether to render an XML prolog or not. The default is true. -
indentWith
Sets the string that should be used to indent children elements. The default is four spaces.- Throws:
NullPointerException- If the argument is null
-