public class XMLFormattingOptions extends LSPFormattingOptions
Modifier and Type | Class and Description |
---|---|
static class |
XMLFormattingOptions.EmptyElements
Options for formatting empty elements.
|
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_CLOSING_BRACKET_NEW_LINE |
static EnforceQuoteStyle |
DEFAULT_ENFORCE_QUOTE_STYLE |
static boolean |
DEFAULT_PRESERVE_ATTR_LINE_BREAKS |
static List<String> |
DEFAULT_PRESERVE_SPACE |
static int |
DEFAULT_PRESERVER_NEW_LINES |
static String |
DEFAULT_QUOTATION |
static int |
DEFAULT_SPLIT_ATTRIBUTES_INDENT_SIZE |
static int |
DEFAULT_TAB_SIZE |
static boolean |
DEFAULT_TRIM_TRAILING_SPACES |
static String |
DEFAULT_XSI_SCHEMA_LOCATION_SPLIT |
Constructor and Description |
---|
XMLFormattingOptions() |
XMLFormattingOptions(boolean initializeDefaults)
Create an XMLFormattingOptions instance with the option to initialize default
values for all supported settings.
|
XMLFormattingOptions(org.eclipse.lsp4j.FormattingOptions options) |
XMLFormattingOptions(org.eclipse.lsp4j.FormattingOptions options,
boolean initializeDefaultSettings) |
XMLFormattingOptions(int tabSize,
boolean insertSpaces) |
XMLFormattingOptions(int tabSize,
boolean insertSpaces,
boolean initializeDefaultSettings) |
Modifier and Type | Method and Description |
---|---|
boolean |
getClosingBracketNewLine()
Returns the value of closingBracketNewLine or false if it was set to null
A setting for enabling the XML formatter to move the closing bracket of a tag
with at least 2 attributes to a new line.
|
XMLFormattingOptions.EmptyElements |
getEmptyElements() |
EnforceQuoteStyle |
getEnforceQuoteStyle() |
FormatElementCategory |
getFormatElementCategory(DOMElement element) |
int |
getMaxLineWidth()
Returns the value of max line width or zero if it was set to a negative value
|
int |
getPreservedNewlines() |
List<String> |
getPreserveSpace()
Returns the element name list which must preserve space.
|
int |
getSplitAttributesIndentSize()
Returns the value of splitAttributesIndentSize or zero if it was set to a
negative value
|
String |
getXsiSchemaLocationSplit() |
boolean |
isEnabled() |
boolean |
isFormatComments() |
boolean |
isGrammarAwareFormatting() |
boolean |
isJoinCDATALines() |
boolean |
isJoinCommentLines() |
boolean |
isJoinContentLines() |
boolean |
isLegacy()
Returns true if the legacy formatter must be used and false otherwise.
|
boolean |
isPreserveAttributeLineBreaks()
Returns the value of preserveAttrLineBreaks
|
boolean |
isPreserveEmptyContent() |
boolean |
isSpaceBeforeEmptyCloseTag() |
boolean |
isSplitAttributes() |
XMLFormattingOptions |
merge(org.eclipse.lsp4j.FormattingOptions formattingOptions) |
XMLFormattingOptions |
merge(XMLFormattingOptions formattingOptions) |
void |
setClosingBracketNewLine(boolean closingBracketNewLine)
Sets the value of closingBracketNewLine
|
void |
setEmptyElement(XMLFormattingOptions.EmptyElements emptyElement) |
void |
setEnabled(boolean enabled) |
void |
setEnforceQuoteStyle(EnforceQuoteStyle enforce) |
void |
setFormatComments(boolean formatComments) |
void |
setGrammarAwareFormatting(boolean grammarAwareFormatting) |
void |
setJoinCDATALines(boolean joinCDATALines) |
void |
setJoinCommentLines(boolean joinCommentLines) |
void |
setJoinContentLines(boolean joinContentLines) |
void |
setLegacy(boolean legacy)
Set true if the legacy formatter must be used and false otherwise.
|
void |
setMaxLineWidth(int maxLineWidth)
Sets the value of max line width.
|
void |
setPreserveAttributeLineBreaks(boolean preserveAttributeLineBreaks)
Sets the value of preserveAttrLineBreaks
|
void |
setPreservedNewlines(int preservedNewlines) |
void |
setPreserveEmptyContent(boolean preserveEmptyContent) |
void |
setPreserveSpace(List<String> preserveSpace)
Sets the element name list which must preserve space.
|
void |
setSpaceBeforeEmptyCloseTag(boolean spaceBeforeEmptyCloseTag) |
void |
setSplitAttributes(boolean splitAttributes) |
void |
setSplitAttributesIndentSize(int splitAttributesIndentSize)
Sets the value of splitAttributesIndentSize
|
void |
setXsiSchemaLocationSplit(String xsiSchemaLocationSplit) |
getTabSize, isInsertFinalNewline, isInsertSpaces, isTrimFinalNewlines, isTrimTrailingWhitespace, setInsertFinalNewline, setInsertSpaces, setTabSize, setTrimFinalNewlines, setTrimTrailingWhitespace
public static final String DEFAULT_QUOTATION
public static final int DEFAULT_PRESERVER_NEW_LINES
public static final int DEFAULT_TAB_SIZE
public static final EnforceQuoteStyle DEFAULT_ENFORCE_QUOTE_STYLE
public static final boolean DEFAULT_PRESERVE_ATTR_LINE_BREAKS
public static final boolean DEFAULT_TRIM_TRAILING_SPACES
public static final int DEFAULT_SPLIT_ATTRIBUTES_INDENT_SIZE
public static final String DEFAULT_XSI_SCHEMA_LOCATION_SPLIT
public static final boolean DEFAULT_CLOSING_BRACKET_NEW_LINE
public XMLFormattingOptions()
public XMLFormattingOptions(boolean initializeDefaults)
public XMLFormattingOptions(int tabSize, boolean insertSpaces, boolean initializeDefaultSettings)
public XMLFormattingOptions(int tabSize, boolean insertSpaces)
public XMLFormattingOptions(org.eclipse.lsp4j.FormattingOptions options, boolean initializeDefaultSettings)
public XMLFormattingOptions(org.eclipse.lsp4j.FormattingOptions options)
public boolean isSplitAttributes()
public void setSplitAttributes(boolean splitAttributes)
public boolean isJoinCDATALines()
public void setJoinCDATALines(boolean joinCDATALines)
public boolean isFormatComments()
public void setFormatComments(boolean formatComments)
public boolean isJoinCommentLines()
public void setJoinCommentLines(boolean joinCommentLines)
public boolean isJoinContentLines()
public void setJoinContentLines(boolean joinContentLines)
public boolean isLegacy()
public void setLegacy(boolean legacy)
legacy
- true if the legacy formatter must be used and false
otherwise.public void setMaxLineWidth(int maxLineWidth)
maxLineWidth
- the new value for max line width.public int getMaxLineWidth()
public boolean isEnabled()
public void setEnabled(boolean enabled)
public void setSpaceBeforeEmptyCloseTag(boolean spaceBeforeEmptyCloseTag)
public boolean isSpaceBeforeEmptyCloseTag()
public void setPreserveEmptyContent(boolean preserveEmptyContent)
public boolean isPreserveEmptyContent()
public void setPreservedNewlines(int preservedNewlines)
public int getPreservedNewlines()
public void setEmptyElement(XMLFormattingOptions.EmptyElements emptyElement)
public XMLFormattingOptions.EmptyElements getEmptyElements()
public void setEnforceQuoteStyle(EnforceQuoteStyle enforce)
public EnforceQuoteStyle getEnforceQuoteStyle()
public void setPreserveAttributeLineBreaks(boolean preserveAttributeLineBreaks)
public boolean isPreserveAttributeLineBreaks()
public void setSplitAttributesIndentSize(int splitAttributesIndentSize)
splitAttributesIndentSize
- the new value for splitAttributesIndentSizepublic int getSplitAttributesIndentSize()
public boolean getClosingBracketNewLine()
public void setClosingBracketNewLine(boolean closingBracketNewLine)
closingBracketNewLine
- the new value for closingBracketNewLinepublic void setPreserveSpace(List<String> preserveSpace)
preserveSpace
- the element name list which must preserve space.public List<String> getPreserveSpace()
public boolean isGrammarAwareFormatting()
public void setGrammarAwareFormatting(boolean grammarAwareFormatting)
public String getXsiSchemaLocationSplit()
public void setXsiSchemaLocationSplit(String xsiSchemaLocationSplit)
public XMLFormattingOptions merge(XMLFormattingOptions formattingOptions)
public XMLFormattingOptions merge(org.eclipse.lsp4j.FormattingOptions formattingOptions)
public FormatElementCategory getFormatElementCategory(DOMElement element)
Copyright © 2022. All rights reserved.