public class XMLGenerator extends Object
Constructor and Description |
---|
XMLGenerator(SharedSettings sharedSettings,
boolean autoCloseTags,
String whitespacesIndent,
String lineDelimiter,
boolean canSupportSnippets,
int maxLevel) |
XMLGenerator(SharedSettings sharedSettings,
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,
ISharedSettingsRequest request)
Returns a markup content for attribute name documentation and null otherwise.
|
static org.eclipse.lsp4j.MarkupContent |
createMarkupContent(CMAttributeDeclaration cmAttribute,
String attributeValue,
CMElementDeclaration ownerElement,
ISharedSettingsRequest support)
Returns a markup content for attribute value documentation and null
otherwise.
|
static org.eclipse.lsp4j.MarkupContent |
createMarkupContent(CMElementDeclaration cmElement,
ISharedSettingsRequest support)
Returns a markup content for element documentation and null otherwise.
|
static org.eclipse.lsp4j.MarkupContent |
createMarkupContent(CMElementDeclaration cmElement,
String textContent,
ISharedSettingsRequest support)
Returns a markup content for element text documentation and null otherwise.
|
String |
generate(CMElementDeclaration elementDeclaration,
String prefix,
boolean generateEndTag)
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,
SharedSettings sharedSettings)
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(SharedSettings sharedSettings, String whitespacesIndent, String lineDelimiter, boolean canSupportSnippets, int maxLevel)
sharedSettings
- the settings containing formatting options (uses spaces or tabs for
indentation, etc) and preferenceswhitespacesIndent
- 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(SharedSettings sharedSettings, boolean autoCloseTags, String whitespacesIndent, String lineDelimiter, boolean canSupportSnippets, int maxLevel)
public String generate(CMElementDeclaration elementDeclaration, String prefix, boolean generateEndTag)
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, SharedSettings sharedSettings)
public static String generateDocumentation(String documentation, String schemaURI, boolean html)
documentation
- schemaURI
- public static org.eclipse.lsp4j.MarkupContent createMarkupContent(CMElementDeclaration cmElement, ISharedSettingsRequest support)
cmElement
- support
- public static org.eclipse.lsp4j.MarkupContent createMarkupContent(CMAttributeDeclaration cmAttribute, CMElementDeclaration ownerElement, ISharedSettingsRequest request)
cmAttribute
- the attribute declarationownerElement
- the owner element declarationrequest
- the requestpublic static org.eclipse.lsp4j.MarkupContent createMarkupContent(CMAttributeDeclaration cmAttribute, String attributeValue, CMElementDeclaration ownerElement, ISharedSettingsRequest support)
cmAttribute
- attributeValue
- ownerElement
- support
- public static org.eclipse.lsp4j.MarkupContent createMarkupContent(CMElementDeclaration cmElement, String textContent, ISharedSettingsRequest support)
cmElement
- element declaration.textContent
- the text content.support
- markup kind support.Copyright © 2021. All rights reserved.