Class XMLTagFormatter.TagFormatter
- java.lang.Object
-
- net.revelc.code.formatter.xml.lib.XMLTagFormatter.TagFormatter
-
- Enclosing class:
- XMLTagFormatter
protected class XMLTagFormatter.TagFormatter extends Object
-
-
Constructor Summary
Constructors Constructor Description TagFormatter(FormattingPreferences prefs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseTag(StringBuilder sb, XMLTagFormatter.Tag tag)Stringformat(XMLTagFormatter.Tag tag, String indent, String lineDelimiter)protected booleanlineRequiresWrap(String line, int lineWidth, int tabWidth)protected voidopenTag(StringBuilder sb, XMLTagFormatter.Tag tag)protected inttabExpandedLineWidth(String line, int tabWidth)protected StringwrapTag(XMLTagFormatter.Tag tag, String indent, String lineDelimiter)
-
-
-
Constructor Detail
-
TagFormatter
public TagFormatter(FormattingPreferences prefs)
-
-
Method Detail
-
openTag
protected void openTag(StringBuilder sb, XMLTagFormatter.Tag tag)
-
closeTag
protected void closeTag(StringBuilder sb, XMLTagFormatter.Tag tag)
-
format
public String format(XMLTagFormatter.Tag tag, String indent, String lineDelimiter)
-
lineRequiresWrap
protected boolean lineRequiresWrap(String line, int lineWidth, int tabWidth)
-
tabExpandedLineWidth
protected int tabExpandedLineWidth(String line, int tabWidth)
- Parameters:
line- the line in which spaces are to be expandedtabWidth- number of spaces to substitute for a tab- Returns:
- length of the line with tabs expanded to spaces
-
wrapTag
protected String wrapTag(XMLTagFormatter.Tag tag, String indent, String lineDelimiter)
-
-