@OpenApiAll
public class CoreTextCreator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NEW_LINE_SEPARATOR |
static java.lang.String |
TYPE_SEPARATOR |
static boolean |
USE_STANDARD_STEREOTYPE_CHAR |
static java.lang.String |
VALUE_SEPARATOR |
Constructor and Description |
---|
CoreTextCreator() |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
containsParentheses(java.lang.String string) |
static TextBuilder |
createElementNumberText(Element element,
java.util.function.Supplier<TextBuilder> builderFactory)
Create the element's number (auto id) text
|
static java.lang.String |
createMultiplicityRangeText(java.lang.Integer range)
Creates multiplicity range text.
|
static java.lang.String |
createMultiplicityText(java.lang.Integer lower,
java.lang.Integer upper)
Creates multiplicity text.
|
static TextBuilder |
createMultiplicityText(MultiplicityElement element,
MultiplicityTextParams textParams,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates text representation of given element
MultiplicityElement . |
static java.lang.String |
createMultiplicityText(java.lang.String lower,
java.lang.String upper,
boolean ordered,
boolean unique,
MultiplicityTextParams textParams)
Creates text representation of given multiplicity range.
|
static java.lang.String |
createMultiplicityText(java.lang.String lower,
java.lang.String upper,
ValueSpecification lowerValue,
boolean unique,
boolean ordered,
MultiplicityTextParams textParams)
Creates string representation of the provided multiplicity range.
|
static TextBuilder |
createMultiplicityText(TextBuilder lower,
TextBuilder upper,
boolean ordered,
boolean unique,
MultiplicityTextParams textParams,
java.util.function.Supplier<TextBuilder> builderFactory)
Returns text representation of given multiplicity.
|
static TextBuilder |
createMultiplicityText(TextBuilder lower,
TextBuilder upper,
ValueSpecification lowerValue,
boolean unique,
boolean ordered,
MultiplicityTextParams textParams,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the provided multiplicity range.
|
static TextBuilder |
createNamedElementListText(java.util.List<? extends NamedElement> elements,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates representation text for a list of named elements, which contains names separated by a comma.
|
static TextBuilder |
createStereotypesText(java.util.Collection<Stereotype> stereotypes,
java.lang.String separator,
StereotypeTextParams textParams,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the collection of
Stereotype elements. |
static TextBuilder |
createStereotypesText(Element element,
java.lang.String separator,
StereotypeTextParams textParams,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of stereotypes that are applied to the provided element
|
static TextBuilder |
createStereotypeText(Stereotype stereotype,
StereotypeTextParams textParams,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given
Stereotype . |
static java.lang.String |
createStereotypeText(java.lang.String stereotypeName) |
static TextBuilder |
createStringCollectionText(java.util.Collection<java.lang.String> strings,
java.lang.String separator,
java.util.function.Supplier<TextBuilder> builderFactory)
Joins strings
|
static TextBuilder |
createStyledTypeText(Type type,
boolean showQualifiedName,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates colored string representation of the given
Type . |
static TextBuilder |
createStyledTypeTextWithSeparator(Type type,
boolean showQualifiedName,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates colored string representation of the given
Type . |
static TextBuilder |
createTypeText(java.util.Collection<? extends Type> types,
boolean showQualifiedName,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given
Type elements, separated by comma. |
static TextBuilder |
createTypeText(Type type,
boolean showQualifiedName,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given
Type . |
static TextBuilder |
createValueSpecificationText(ValueSpecification valueSpecification,
boolean addBraces,
java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given
ValueSpecification . |
static <T extends TextBuilder> |
createValueSpecificationText(ValueSpecification valueSpecification,
java.util.function.Supplier<T> builderFactory)
Creates string representation of the given
ValueSpecification with no braces. |
static java.lang.String |
createVisibilityText(VisibilityKind visibility)
Returns visibility representation(+, # or -)
|
protected static <T> TextBuilder |
join(TextBuilder textBuilder,
java.lang.String delimiter,
java.util.stream.Stream<T> elements,
java.util.function.Function<T,TextBuilder> map) |
public static boolean USE_STANDARD_STEREOTYPE_CHAR
public static final java.lang.String TYPE_SEPARATOR
public static final java.lang.String NEW_LINE_SEPARATOR
public static final java.lang.String VALUE_SEPARATOR
public static TextBuilder createTypeText(java.util.Collection<? extends Type> types, boolean showQualifiedName, java.util.function.Supplier<TextBuilder> builderFactory)
Type
elements, separated by comma.types
- collection of typesshowQualifiedName
- true to include type's qualified namebuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static TextBuilder createTypeText(Type type, boolean showQualifiedName, java.util.function.Supplier<TextBuilder> builderFactory)
Type
.type
- element to create representation text forshowQualifiedName
- true to include type's qualified namebuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static TextBuilder createStyledTypeText(Type type, boolean showQualifiedName, java.util.function.Supplier<TextBuilder> builderFactory)
Type
.type
- element to create representation text forshowQualifiedName
- true to include type's qualified namebuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static TextBuilder createStyledTypeTextWithSeparator(Type type, boolean showQualifiedName, java.util.function.Supplier<TextBuilder> builderFactory)
Type
.
Pre-appends CoreTextCreator.TYPE_SEPARATORtype
- element to create representation text forshowQualifiedName
- true to include type's qualified namebuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static TextBuilder createStringCollectionText(java.util.Collection<java.lang.String> strings, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
strings
- strings to joinseparator
- symbol(s) to separate each string withbuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static TextBuilder createNamedElementListText(java.util.List<? extends NamedElement> elements, java.util.function.Supplier<TextBuilder> builderFactory)
elements
- to create joined named representation forpublic static TextBuilder createValueSpecificationText(@CheckForNull ValueSpecification valueSpecification, boolean addBraces, java.util.function.Supplier<TextBuilder> builderFactory)
ValueSpecification
.valueSpecification
- element to create representation text foraddBraces
- true to add braces around the value specification textbuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static <T extends TextBuilder> T createValueSpecificationText(@CheckForNull ValueSpecification valueSpecification, java.util.function.Supplier<T> builderFactory)
ValueSpecification
with no braces.valueSpecification
- element to create representation text forbuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static java.lang.String createMultiplicityText(java.lang.String lower, java.lang.String upper, @CheckForNull ValueSpecification lowerValue, boolean unique, boolean ordered, MultiplicityTextParams textParams)
lower
- lower bounds of the multiplicityupper
- upper bounds of the multiplicitylowerValue
- value specification element that holds the value of the lower boundsordered
- is orderedunique
- is uniquetextParams
- text parameterspublic static TextBuilder createMultiplicityText(TextBuilder lower, TextBuilder upper, @CheckForNull ValueSpecification lowerValue, boolean unique, boolean ordered, MultiplicityTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
lower
- lower bounds of the multiplicityupper
- upper bounds of the multiplicitylowerValue
- value specification element that holds the value of the lower boundsordered
- is orderedunique
- is uniquetextParams
- text parameterspublic static java.lang.String createMultiplicityRangeText(@CheckForNull java.lang.Integer range)
range
- multiplicity range.public static java.lang.String createMultiplicityText(@CheckForNull java.lang.Integer lower, @CheckForNull java.lang.Integer upper)
lower
- Lower range.upper
- Upper range.public static TextBuilder createMultiplicityText(TextBuilder lower, TextBuilder upper, boolean ordered, boolean unique, MultiplicityTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
lower
- Lower valueupper
- Upper valueordered
- orderedunique
- uniquetextParams
- text parameterspublic static java.lang.String createMultiplicityText(@CheckForNull java.lang.String lower, @CheckForNull java.lang.String upper, boolean ordered, boolean unique, MultiplicityTextParams textParams)
lower
- Lower valueupper
- Upper valueordered
- orderedunique
- uniquetextParams
- text parameterspublic static TextBuilder createMultiplicityText(@CheckForNull MultiplicityElement element, MultiplicityTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
MultiplicityElement
.element
- the given multiplicity elementtextParams
- text parametersbuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text toprotected static <T> TextBuilder join(TextBuilder textBuilder, java.lang.String delimiter, java.util.stream.Stream<T> elements, java.util.function.Function<T,TextBuilder> map)
public static java.lang.String createVisibilityText(@CheckForNull VisibilityKind visibility)
visibility
- the given visibility.public static TextBuilder createStereotypesText(Element element, java.lang.String separator, StereotypeTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
element
- to create representation text forseparator
- symbol(s) to separate each stereotype's text withtextParams
- text parametersbuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text toStereotypesHelper
public static TextBuilder createStereotypesText(java.util.Collection<Stereotype> stereotypes, java.lang.String separator, StereotypeTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Stereotype
elements.stereotypes
- collection of stereotypes to create representation text forseparator
- symbol(s) to separate each stereotype's text withtextParams
- configuration that defines what to include in the text of each stereotypebuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static TextBuilder createStereotypeText(Stereotype stereotype, StereotypeTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Stereotype
.stereotype
- element to create representation text fortextParams
- configuration that defines what to include in the text of the stereotypebuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text topublic static java.lang.String createStereotypeText(@CheckForNull java.lang.String stereotypeName)
protected static boolean containsParentheses(java.lang.String string)
public static TextBuilder createElementNumberText(Element element, java.util.function.Supplier<TextBuilder> builderFactory)
element
- the element that can be numberedbuilderFactory
- provides @{link com.nomagic.text.builders.TextBuilder} to append the created text to