public class XMLGenerator extends Object
Constructor and Description |
---|
XMLGenerator(XMLFormattingOptions formattingOptions,
boolean autoCloseTags,
String whitespacesIndent,
String lineDelimiter,
boolean canSupportSnippets,
int maxLevel) |
XMLGenerator(XMLFormattingOptions formattingOptions,
String whitespacesIndent,
String lineDelimiter,
boolean canSupportSnippets,
int maxLevel)
XML generator constructor.
|
Modifier and Type | Method and Description |
---|---|
static org.eclipse.lsp4j.MarkupContent |
createMarkupContent(CMAttributeDeclaration cmAttribute,
CMElementDeclaration ownerElement,
MarkupContentFactory.IMarkupKindSupport support)
Returns a markup content for attribute name documentation and null otherwise.
|
static org.eclipse.lsp4j.MarkupContent |
createMarkupContent(CMAttributeDeclaration cmAttribute,
String attributeValue,
CMElementDeclaration ownerElement,
MarkupContentFactory.IMarkupKindSupport support)
Returns a markup content for attribute value documentation and null
otherwise.
|
static org.eclipse.lsp4j.MarkupContent |
createMarkupContent(CMElementDeclaration cmElement,
MarkupContentFactory.IMarkupKindSupport support)
Returns a markup content for element documentation and null otherwise.
|
String |
generate(CMElementDeclaration elementDeclaration) |
String |
generate(CMElementDeclaration elementDeclaration,
String prefix)
Returns the XML generated from the given element declaration.
|
String |
generate(Collection<CMAttributeDeclaration> attributes,
String tagName) |
static String |
generateAttributeValue(String defaultValue,
Collection<String> enumerationValues,
boolean canSupportSnippets,
int snippetIndex,
boolean withQuote)
Creates the string value for a CompletionItem TextEdit
Can create an enumerated TextEdit if given a collection of values.
|
static String |
generateAttributeValue(String defaultValue,
Collection<String> enumerationValues,
boolean canSupportSnippets,
int snippetIndex,
boolean withQuote,
XMLFormattingOptions formattingSettings)
Creates the string value for a CompletionItem TextEdit
Can create an enumerated TextEdit if given a collection of values.
|
static String |
generateDocumentation(String documentation,
String schemaURI,
boolean html)
Returns a properly formatted documentation string with source.
|
public XMLGenerator(XMLFormattingOptions formattingOptions, String whitespacesIndent, String lineDelimiter, boolean canSupportSnippets, int maxLevel)
formattingOptions
- the formatting options (uses spaces or tabs for
indentation, etc)whitespacesIndent
- the whitespaces to use to indent XML children
elements.lineDelimiter
- the line delimiter to use when several XML elements
must be generated.canSupportSnippets
- true if snippets can be supported and false
otherwise.public XMLGenerator(XMLFormattingOptions formattingOptions, boolean autoCloseTags, String whitespacesIndent, String lineDelimiter, boolean canSupportSnippets, int maxLevel)
public String generate(CMElementDeclaration elementDeclaration)
public String generate(CMElementDeclaration elementDeclaration, String prefix)
elementDeclaration
- prefix
- public String generate(Collection<CMAttributeDeclaration> attributes, String tagName)
public static String generateAttributeValue(String defaultValue, Collection<String> enumerationValues, boolean canSupportSnippets, int snippetIndex, boolean withQuote)
public static String generateAttributeValue(String defaultValue, Collection<String> enumerationValues, boolean canSupportSnippets, int snippetIndex, boolean withQuote, XMLFormattingOptions formattingSettings)
public static String generateDocumentation(String documentation, String schemaURI, boolean html)
documentation
- schemaURI
- public static org.eclipse.lsp4j.MarkupContent createMarkupContent(CMElementDeclaration cmElement, MarkupContentFactory.IMarkupKindSupport support)
cmElement
- support
- public static org.eclipse.lsp4j.MarkupContent createMarkupContent(CMAttributeDeclaration cmAttribute, CMElementDeclaration ownerElement, MarkupContentFactory.IMarkupKindSupport support)
cmAttribute
- ownerElement
- support
- public static org.eclipse.lsp4j.MarkupContent createMarkupContent(CMAttributeDeclaration cmAttribute, String attributeValue, CMElementDeclaration ownerElement, MarkupContentFactory.IMarkupKindSupport support)
cmAttribute
- attributeValue
- ownerElement
- support
- Copyright © 2020. All rights reserved.