Class XMLGenerationSettings
java.lang.Object
org.eclipse.lemminx.extensions.contentmodel.generator.XMLGenerationSettings
Settings for XML document generation from grammar.
These settings control how XMLDocumentGenerator produces XML content
from a grammar (XSD, DTD, RelaxNG, RNC). They can be configured globally via
client settings or per-grammar via generation profiles.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA generation profile that overrides global settings for grammars matching a glob pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final booleanstatic final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum depth for nested element generation.Returns the generation profiles list.booleanReturns whether optional elements should be generated.booleanReturns whether type-aware default values should be generated (e.g., "0" for xs:integer, "2026-01-01" for xs:date).Returns a resolved copy of these settings by applying the first matching profile for the given grammar URI.voidsetMaxDepth(int maxDepth) Sets the maximum depth for nested element generation.voidsetOptionalElements(boolean optionalElements) Sets whether optional elements should be generated.voidSets the generation profiles list.voidsetTypeDefaults(boolean typeDefaults) Sets whether type-aware default values should be generated.
-
Field Details
-
DEFAULT_MAX_DEPTH
public static final int DEFAULT_MAX_DEPTH- See Also:
-
DEFAULT_OPTIONAL_ELEMENTS
public static final boolean DEFAULT_OPTIONAL_ELEMENTS- See Also:
-
DEFAULT_TYPE_DEFAULTS
public static final boolean DEFAULT_TYPE_DEFAULTS- See Also:
-
-
Constructor Details
-
XMLGenerationSettings
public XMLGenerationSettings()
-
-
Method Details
-
getMaxDepth
public int getMaxDepth()Returns the maximum depth for nested element generation.- Returns:
- the maximum depth (default 10).
-
setMaxDepth
public void setMaxDepth(int maxDepth) Sets the maximum depth for nested element generation.- Parameters:
maxDepth- the maximum depth.
-
isOptionalElements
public boolean isOptionalElements()Returns whether optional elements should be generated.- Returns:
- true if optional elements should be generated (default true).
-
setOptionalElements
public void setOptionalElements(boolean optionalElements) Sets whether optional elements should be generated.- Parameters:
optionalElements- true to generate optional elements.
-
isTypeDefaults
public boolean isTypeDefaults()Returns whether type-aware default values should be generated (e.g., "0" for xs:integer, "2026-01-01" for xs:date).- Returns:
- true if type-aware defaults should be generated (default true).
-
setTypeDefaults
public void setTypeDefaults(boolean typeDefaults) Sets whether type-aware default values should be generated.- Parameters:
typeDefaults- true to generate type-aware defaults.
-
getProfiles
Returns the generation profiles list.- Returns:
- the profiles list, or null if none.
-
setProfiles
Sets the generation profiles list.- Parameters:
profiles- the profiles list.
-
resolve
Returns a resolved copy of these settings by applying the first matching profile for the given grammar URI. If no profile matches, returns a copy with the global settings.Profile matching uses
forinvalid reference
PathPatternMatcherfile://URIs (Java NIO glob) and a simple textual glob match forhttp:///https://URIs.- Parameters:
grammarURI- the grammar file URI to match against profile patterns.- Returns:
- the resolved settings.
-