Package com.nomagic.magicdraw.uml.text
Class ModelTextCreator
- java.lang.Object
-
- com.nomagic.magicdraw.uml.text.CoreTextCreator
-
- com.nomagic.magicdraw.uml.text.ModelTextCreator
-
@OpenApiAll public class ModelTextCreator extends CoreTextCreator
Contains methods to create representation text for various model elements
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ELEMENTS_PROPERTY_KEY
-
Fields inherited from class com.nomagic.magicdraw.uml.text.CoreTextCreator
NEW_LINE_SEPARATOR, TYPE_SEPARATOR, VALUE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description ModelTextCreator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
appendSlotFeatureTaggedValues(Slot slot, SlotTextParams textParams, TextBuilder builder, java.util.function.Supplier<TextBuilder> builderFactory)
private static boolean
appendSlotValues(Slot slot, SlotTextParams textParams, TextBuilder builder, RepTextContext context)
private static void
appendTaggedValueDerivedSign(TaggedValue taggedValue, TaggedValueTextParams textParams, TextBuilder builder)
private static boolean
appendTaggedValueValues(TaggedValue taggedValue, TaggedValueTextParams textParams, TextBuilder builder, RepTextContext context)
private static boolean
areSlotValuesElements(Slot slot)
static TextBuilder
createActivityEdgeText(ActivityEdge activityEdge, boolean showWeight, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenActivityEdge
.static TextBuilder
createActivityParameterNodeText(ActivityParameterNode parameterNode, boolean showFullType, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenActivityParameterNode
.private static TextBuilder
createArgumentText(ValueSpecification argument, boolean trimEmpty, java.util.function.Supplier<TextBuilder> builderFactory)
Creates the argument text.static TextBuilder
createAssociationText(Association association, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenAssociation
.static TextBuilder
createBehaviorText(Behavior behavior, BehaviorTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenBehavior
.static TextBuilder
createCombinedFragmentOperatorText(CombinedFragment combinedFragment, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenCombinedFragment
.static TextBuilder
createConstraintsText(java.util.Collection<Constraint> constraints, ConstraintTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the given collection ofConstraint
elements.static TextBuilder
createConstraintText(Constraint constraint, ConstraintTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenConstraint
.static TextBuilder
createEnumerationLiteralText(EnumerationLiteral enumerationLiteral, MemberTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenEnumerationLiteral
.static TextBuilder
createEventText(Event event, EventTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenEvent
.static TextBuilder
createGuardText(Message message, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the provided message's guard.static TextBuilder
createInstanceSpecificationText(InstanceSpecification instance, InstanceSpecificationTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenInstanceSpecification
.static TextBuilder
createInstanceSpecificationText(InstanceSpecification instance, InstanceSpecificationTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory, java.util.function.Predicate<Element> classifierFilter)
Creates string representation of the givenInstanceSpecification
.static TextBuilder
createInteractionUseText(CallBehaviorAction callBehaviorAction, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenCallBehaviorAction
that is displayed as InteractionUse.private static TextBuilder
createInteractionUseText(NamedElement referTo, java.util.Collection<ValueSpecification> arguments, java.util.function.Supplier<TextBuilder> builderFactory)
static TextBuilder
createInteractionUseText(InteractionUse interactionUse, InteractionUseTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenInteractionUse
.static TextBuilder
createMessageText(Message message, MessageTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenMessage
.static TextBuilder
createOperandGuardText(InteractionOperand interactionOperand, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the guard of the givenInteractionOperand
.static TextBuilder
createOperationText(Operation operation, OperationTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenOperation
.static TextBuilder
createParameterDirectionText(ParameterDirectionKind parameterDirection, com.nomagic.uml2.project.ElementProject project, ParameterDirectionTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenParameterDirectionKind
static TextBuilder
createParametersText(java.util.Collection<Parameter> parameters, ParameterTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the given collection ofParameter
elements, separated by commastatic TextBuilder
createParameterText(Parameter parameter, ParameterTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenParameter
.static TextBuilder
createPinText(Pin pin, PinTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenPin
.static TextBuilder
createPropertyText(Property property, PropertyTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenProperty
.static TextBuilder
createProtocolTransitionText(ProtocolTransition transition, TransitionTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenProtocolTransition
.static TextBuilder
createReceptionText(Reception reception, ReceptionTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenReception
.static TextBuilder
createRelationshipFromToText(Element relationship, Element clientModelElement, java.lang.String clientName, Element supplierModelElement, java.lang.String supplierName, boolean addFullQualifiedName, java.util.function.Supplier<TextBuilder> builderFactory)
Create relation representation text part to represent from what element to what element relation is connected.static TextBuilder
createSlotsText(java.util.Collection<Slot> slots, SlotTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of given slots collection (without braces).static TextBuilder
createSlotsTextWithBraces(java.util.Collection<Slot> slots, SlotTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of given slots collection, wrapped between '{' and '}'.static TextBuilder
createSlotText(Slot slot, SlotTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given slot.static TextBuilder
createSlotText(Slot slot, SlotTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory, RepTextContext context)
Creates string representation of the given slot.static TextBuilder
createStateText(State state, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenState
.static TextBuilder
createTaggedValuesText(java.util.Collection<TaggedValue> taggedValues, TaggedValueTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of given taggedValues collection (without braces).static TextBuilder
createTaggedValuesTextWithBraces(java.util.Collection<TaggedValue> taggedValues, TaggedValueTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of given taggedValues collection, wrapped between '{' and '}'.static TextBuilder
createTaggedValueText(TaggedValue taggedValue, TaggedValueTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given taggedValue.static TextBuilder
createTaggedValueText(TaggedValue taggedValue, TaggedValueTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory, RepTextContext context)
Creates string representation of the given taggedValue.static TextBuilder
createTemplateBindingText(TemplateBinding templateBinding, boolean showTemplateParameterInfo, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTemplateBinding
.static TextBuilder
createTemplateParametersText(java.util.Collection<TemplateParameter> templateParameters, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the given collection ofTemplateParameter
elements.static TextBuilder
createTemplateParameterSubstitutionText(TemplateParameterSubstitution parameterSubstitution, boolean showTemplateParameterInfo, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTemplateParameterSubstitution
.static TextBuilder
createTemplateParameterText(TemplateParameter templateParameter, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTemplateParameter
.static TextBuilder
createTransitionText(Transition transition, TransitionTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given Transition.static TextBuilder
createTriggersText(java.util.Collection<?> triggers, TriggerTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the given collection ofTrigger
elements, separated by comma.static TextBuilder
createTriggerText(Trigger trigger, TriggerTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTrigger
.static TextBuilder
createTypedElementText(TypedElement typedElement, TypedElementTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTypedElement
.private static java.lang.String
elementAsString(Element el, boolean qualifiedName, RepTextContext context)
private static java.util.List<ValueSpecification>
getArgumentsWithoutReturn(java.util.List<ValueSpecification> arguments)
Given a list of arguments, returns a list of arguments without an argument referencing the return parameter.private static java.util.List<java.lang.String>
getAttributesOrParametersNames(MessageTextParams params, Signal signal, Operation operation)
private static TextBuilder
getDefaultValueAsString(ParameterableElement defaultValue, java.util.function.Supplier<TextBuilder> builderFactory)
private static java.lang.String
getRepText(Element element, com.nomagic.magicdraw.uml.text.RepTextParams params, RepTextContext context)
private static ValueSpecification
getReturnArgument(java.lang.Iterable<ValueSpecification> arguments)
Gets an argument which references a return parameter.private static java.lang.String
getSlotNameAndType(Slot slot, SlotTextParams textParams)
private static java.util.List<java.lang.Object>
getSlotValues(Slot slot, SlotTextParams textParams, RepTextContext context)
private static java.lang.String
getTaggedValueDefinitionName(TaggedValue taggedValue, TaggedValueTextParams textParams)
private static java.util.List<?>
getTaggedValueValues(TaggedValue taggedValue, TaggedValueTextParams textParams)
private static boolean
isDefaultParameterDirection(ParameterDirectionKind parameterDirection, com.nomagic.uml2.project.ElementProject project, java.lang.Class<? extends Parameter> parameterMetaType)
private static RawTextBuilder
slotValueToStrings(SlotTextParams textParams, java.lang.Object value, RepTextContext context)
private static RawTextBuilder
taggedValueValueToStrings(TaggedValueTextParams textParams, java.lang.Object value, RepTextContext context)
private static java.util.List<java.lang.String>
toNames(java.util.Collection<? extends NamedElement> elements)
-
Methods inherited from class com.nomagic.magicdraw.uml.text.CoreTextCreator
containsParentheses, createElementNumberText, createMultiplicityRangeText, createMultiplicityText, createMultiplicityText, createMultiplicityText, createMultiplicityText, createMultiplicityText, createMultiplicityText, createNamedElementListText, createStereotypesText, createStereotypesText, createStereotypeText, createStereotypeText, createStringCollectionText, createStyledTypeText, createStyledTypeTextWithSeparator, createTypeText, createTypeText, createValueSpecificationText, createValueSpecificationText, createVisibilityText, isUseStandardStereotypeChar, join, setUseStandardStereotypeChar
-
-
-
-
Field Detail
-
ELEMENTS_PROPERTY_KEY
public static final java.lang.String ELEMENTS_PROPERTY_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
createActivityEdgeText
public static TextBuilder createActivityEdgeText(ActivityEdge activityEdge, boolean showWeight, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenActivityEdge
.- Parameters:
activityEdge
- element to create representation text forshowWeight
- when true, weight information will be included to the textbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the activity edge's text appended
-
createConstraintsText
public static TextBuilder createConstraintsText(java.util.Collection<Constraint> constraints, ConstraintTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the given collection ofConstraint
elements.- Parameters:
constraints
- collection of constraint elements to create representation text fortextParams
- configuration that defines what to include in the text of the constraintseparator
- symbol(s) to separate each constraint's text withbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the constraints' text appended
- See Also:
createConstraintText(Constraint, ConstraintTextParams, Supplier)
-
createConstraintText
public static TextBuilder createConstraintText(@CheckForNull Constraint constraint, ConstraintTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenConstraint
.- Parameters:
constraint
- element to create representation text fortextParams
- configuration that defines what to include in the text of the constraintbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the constraint's text appended
-
createPinText
public static TextBuilder createPinText(Pin pin, PinTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenPin
.- Parameters:
pin
- element to create representation text fortextParams
- configuration that defines what to include in the text of the pinbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the pin's text appended
-
createCombinedFragmentOperatorText
public static TextBuilder createCombinedFragmentOperatorText(CombinedFragment combinedFragment, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenCombinedFragment
.- Parameters:
combinedFragment
- element to create representation text forbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the combinedFragment's text appended
-
createOperandGuardText
public static TextBuilder createOperandGuardText(InteractionOperand interactionOperand, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the guard of the givenInteractionOperand
.- Parameters:
interactionOperand
- element to create representation text forbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the guard's text appended
-
createTransitionText
public static TextBuilder createTransitionText(Transition transition, TransitionTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given Transition. Keep in mind that text is different for protocol transition.
Syntax ofTransition
:trigger[guard]/effect
.
Syntax ofProtocolTransition
:[precondition]trigger/[postcondition]
.- Parameters:
transition
- element to create representation text fortextParams
- configuration that defines what to include in the text of the ?builderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the transition's text appended
-
createProtocolTransitionText
public static TextBuilder createProtocolTransitionText(ProtocolTransition transition, TransitionTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenProtocolTransition
. Syntax:[precondition]trigger/[postcondition]
.- Parameters:
transition
- element to create representation text fortextParams
- configuration that defines what to include in the text of the ?builderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the transition's text appended
-
createTriggersText
public static TextBuilder createTriggersText(java.util.Collection<?> triggers, TriggerTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the given collection ofTrigger
elements, separated by comma.- Parameters:
triggers
- collection of trigger elements to create representation text fortextParams
- configuration that defines what to include in the text of the triggerbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the trigger's text appended
- See Also:
createTriggerText(Trigger, TriggerTextParams, Supplier)
-
createTriggerText
public static TextBuilder createTriggerText(Trigger trigger, TriggerTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTrigger
.- Parameters:
trigger
- element to create representation text fortextParams
- configuration that defines what to include in the text of the triggerbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the trigger's text appended
-
createEventText
public static TextBuilder createEventText(Event event, EventTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenEvent
.- Parameters:
event
- element to create representation text fortextParams
- configuration that defines what to include in the text of the eventbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the event's text appended
-
createBehaviorText
public static TextBuilder createBehaviorText(Behavior behavior, BehaviorTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenBehavior
.- Parameters:
behavior
- element to create representation text fortextParams
- configuration that defines what to include in the text of the behaviorbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the behavior's text appended
-
createInteractionUseText
public static TextBuilder createInteractionUseText(InteractionUse interactionUse, InteractionUseTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenInteractionUse
.- Parameters:
interactionUse
- element to create representation text fortextParams
- configuration that defines what to include in the text of the interactionUsebuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the interactionUse's text appended
-
createInteractionUseText
public static TextBuilder createInteractionUseText(CallBehaviorAction callBehaviorAction, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenCallBehaviorAction
that is displayed as InteractionUse.- Parameters:
callBehaviorAction
- element to create representation text forbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the action's text appended
-
createInteractionUseText
private static TextBuilder createInteractionUseText(@CheckForNull NamedElement referTo, java.util.Collection<ValueSpecification> arguments, java.util.function.Supplier<TextBuilder> builderFactory)
-
createMessageText
public static TextBuilder createMessageText(Message message, MessageTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenMessage
.- Parameters:
message
- element to create representation text fortextParams
- configuration that defines what to include in the text of the messagebuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the message's text appended
-
getAttributesOrParametersNames
private static java.util.List<java.lang.String> getAttributesOrParametersNames(MessageTextParams params, @CheckForNull Signal signal, @CheckForNull Operation operation)
-
toNames
private static java.util.List<java.lang.String> toNames(java.util.Collection<? extends NamedElement> elements)
-
getArgumentsWithoutReturn
private static java.util.List<ValueSpecification> getArgumentsWithoutReturn(java.util.List<ValueSpecification> arguments)
Given a list of arguments, returns a list of arguments without an argument referencing the return parameter.- Parameters:
arguments
- arguments to analyze.- Returns:
- a list of arguments without return argument.
-
getReturnArgument
@CheckForNull private static ValueSpecification getReturnArgument(java.lang.Iterable<ValueSpecification> arguments)
Gets an argument which references a return parameter.- Parameters:
arguments
- arguments from which to get.- Returns:
- argument which references a return parameter.
-
createArgumentText
private static TextBuilder createArgumentText(ValueSpecification argument, boolean trimEmpty, java.util.function.Supplier<TextBuilder> builderFactory)
Creates the argument text.- Parameters:
argument
- the argumenttrimEmpty
- the trim empty- Returns:
- the string
-
createAssociationText
public static TextBuilder createAssociationText(Association association, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenAssociation
.- Parameters:
association
- element to create representation text forbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the association's text appended
-
createStateText
public static TextBuilder createStateText(State state, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenState
.- Parameters:
state
- element to create representation text forbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the state's text appended
-
createParametersText
public static TextBuilder createParametersText(java.util.Collection<Parameter> parameters, ParameterTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the given collection ofParameter
elements, separated by comma- Parameters:
parameters
- collection of parameters to create representation text fortextParams
- configuration that defines what to include in the text of each parameterbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the parameters' text appended
-
createParameterText
public static TextBuilder createParameterText(Parameter parameter, ParameterTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenParameter
.- Parameters:
parameter
- element to create representation text fortextParams
- configuration that defines what to include in the text of the parameterbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the parameter's text appended
-
createParameterDirectionText
public static TextBuilder createParameterDirectionText(@CheckForNull ParameterDirectionKind parameterDirection, com.nomagic.uml2.project.ElementProject project, ParameterDirectionTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenParameterDirectionKind
- Parameters:
parameterDirection
- direction to create representation text forproject
- project to which parameter belongstextParams
- configuration that defines what to include in the text of the parameter directionbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the parameter direction text appended
-
isDefaultParameterDirection
private static boolean isDefaultParameterDirection(@CheckForNull ParameterDirectionKind parameterDirection, com.nomagic.uml2.project.ElementProject project, java.lang.Class<? extends Parameter> parameterMetaType)
-
createOperationText
public static TextBuilder createOperationText(Operation operation, OperationTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenOperation
.- Parameters:
operation
- element to create representation text fortextParams
- configuration that defines what to include in the text of the operationbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the operation's text appended
-
createReceptionText
public static TextBuilder createReceptionText(Reception reception, ReceptionTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenReception
.- Parameters:
reception
- element to create representation text fortextParams
- configuration that defines what to include in the text of the receptionbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the reception's text appended
-
createPropertyText
public static TextBuilder createPropertyText(Property property, PropertyTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenProperty
.- Parameters:
property
- element to create representation text fortextParams
- configuration that defines what to include in the text of the propertybuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the property's text appended
-
createActivityParameterNodeText
public static TextBuilder createActivityParameterNodeText(ActivityParameterNode parameterNode, boolean showFullType, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenActivityParameterNode
.- Parameters:
parameterNode
- element to create representation text forshowFullType
- true if qualified name should be included in the text of node's typebuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the node's text appended
-
createGuardText
public static TextBuilder createGuardText(Message message, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the provided message's guard.- Parameters:
message
- element for which guard representation text has to be createdbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the guard's text appended
-
createEnumerationLiteralText
public static TextBuilder createEnumerationLiteralText(EnumerationLiteral enumerationLiteral, MemberTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenEnumerationLiteral
.- Parameters:
enumerationLiteral
- element to create representation text fortextParams
- configuration that defines what to include in the text of the enumeration literalbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the enumeration literal's text appended
-
createTemplateParameterText
public static TextBuilder createTemplateParameterText(TemplateParameter templateParameter, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTemplateParameter
.- Parameters:
templateParameter
- element to create representation text forbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the template parameter's text appended
-
getDefaultValueAsString
@CheckForNull private static TextBuilder getDefaultValueAsString(@CheckForNull ParameterableElement defaultValue, java.util.function.Supplier<TextBuilder> builderFactory)
-
createTemplateParametersText
public static TextBuilder createTemplateParametersText(java.util.Collection<TemplateParameter> templateParameters, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation for the given collection ofTemplateParameter
elements.- Parameters:
templateParameters
- collection of template parameter elements to create representation text forseparator
- symbol(s) to separate each parameter's text withbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the parameters' text appended
- See Also:
createTemplateParameterText(TemplateParameter, Supplier)
-
createTemplateBindingText
public static TextBuilder createTemplateBindingText(TemplateBinding templateBinding, boolean showTemplateParameterInfo, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTemplateBinding
.- Parameters:
templateBinding
- element to create representation text forshowTemplateParameterInfo
- indicates if full template parameter notation should be used.builderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the template binding's text appended
-
createTemplateParameterSubstitutionText
public static TextBuilder createTemplateParameterSubstitutionText(TemplateParameterSubstitution parameterSubstitution, boolean showTemplateParameterInfo, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTemplateParameterSubstitution
.- Parameters:
parameterSubstitution
- element to create representation text forshowTemplateParameterInfo
- indicates if full template parameter notation should be used.builderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the parameter substitution's text appended
-
createInstanceSpecificationText
public static TextBuilder createInstanceSpecificationText(InstanceSpecification instance, InstanceSpecificationTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenInstanceSpecification
.- Parameters:
instance
- element to create representation text fortextParams
- configuration that defines what to include in the text of the instancebuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the instance's text appended
-
createInstanceSpecificationText
public static TextBuilder createInstanceSpecificationText(InstanceSpecification instance, InstanceSpecificationTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory, java.util.function.Predicate<Element> classifierFilter)
Creates string representation of the givenInstanceSpecification
.- Parameters:
instance
- element to create representation text fortextParams
- configuration that defines what to include in the text of the instancebuilderFactory
- providesTextBuilder
to append the created text toclassifierFilter
- provides ability to filter classifiers.- Returns:
- builder with the instance's text appended
-
createRelationshipFromToText
public static TextBuilder createRelationshipFromToText(Element relationship, @CheckForNull Element clientModelElement, java.lang.String clientName, @CheckForNull Element supplierModelElement, java.lang.String supplierName, boolean addFullQualifiedName, java.util.function.Supplier<TextBuilder> builderFactory)
Create relation representation text part to represent from what element to what element relation is connected. For example if we connect Connector to 2 properties a and b, that are Owned by class Class1. In Containment browser we would see "Connector[Class1::a - Class1::b]" so this method returns the part for the representation "[Class1::a - Class1::b]".- Parameters:
relationship
- relationship for which we want the representation partclientModelElement
- first (from) elementclientName
- name or custom text of first (from) elementsupplierModelElement
- second (to) elementsupplierName
- name or custom text of second (to) elementaddFullQualifiedName
- if true, full qualified name will be added to client and supplier namesbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the relation text appended
-
createTypedElementText
public static TextBuilder createTypedElementText(TypedElement typedElement, TypedElementTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the givenTypedElement
.- Parameters:
typedElement
- element to create representation text fortextParams
- configuration that defines what to include in the text of the typed elementbuilderFactory
- providesTextBuilder
to append the created text to- Returns:
- builder with the typed element's text appended
-
createSlotsTextWithBraces
public static TextBuilder createSlotsTextWithBraces(java.util.Collection<Slot> slots, SlotTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of given slots collection, wrapped between '{' and '}'.- Parameters:
slots
- collection of slotstextParams
- configuration that defines what to include in the text of a slotseparator
- symbol(s) to separate each slot's text withbuilderFactory
- providesTextBuilder
to append created text to- Returns:
- builder with the slots text appended
-
createSlotsText
public static TextBuilder createSlotsText(java.util.Collection<Slot> slots, SlotTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of given slots collection (without braces).- Parameters:
slots
- collection of slotstextParams
- configuration that defines what to include in the text of a slotseparator
- symbol(s) to separate each slot's text withbuilderFactory
- providesTextBuilder
to append created text to- Returns:
- builder with the slots text appended
-
createSlotText
public static TextBuilder createSlotText(Slot slot, SlotTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given slot.- Parameters:
slot
- element to create representation text fortextParams
- configuration that defines what to include in the text of a slotbuilderFactory
- providesTextBuilder
to append created text to- Returns:
- builder with the slot's text appended
-
createSlotText
public static TextBuilder createSlotText(Slot slot, SlotTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory, RepTextContext context)
Creates string representation of the given slot.- Parameters:
slot
- element to create representation text fortextParams
- configuration that defines what to include in the text of a slotbuilderFactory
- providesTextBuilder
to append created text tocontext
- representation text creator invoker- Returns:
- builder with the slot's text appended
-
appendSlotValues
private static boolean appendSlotValues(Slot slot, SlotTextParams textParams, TextBuilder builder, RepTextContext context)
-
slotValueToStrings
private static RawTextBuilder slotValueToStrings(SlotTextParams textParams, java.lang.Object value, RepTextContext context)
-
getSlotNameAndType
@CheckForNull private static java.lang.String getSlotNameAndType(Slot slot, SlotTextParams textParams)
-
appendSlotFeatureTaggedValues
private static void appendSlotFeatureTaggedValues(Slot slot, SlotTextParams textParams, TextBuilder builder, java.util.function.Supplier<TextBuilder> builderFactory)
-
getSlotValues
private static java.util.List<java.lang.Object> getSlotValues(Slot slot, SlotTextParams textParams, RepTextContext context)
-
areSlotValuesElements
private static boolean areSlotValuesElements(Slot slot)
-
elementAsString
private static java.lang.String elementAsString(@CheckForNull Element el, boolean qualifiedName, RepTextContext context)
-
createTaggedValuesText
public static TextBuilder createTaggedValuesText(java.util.Collection<TaggedValue> taggedValues, TaggedValueTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of given taggedValues collection (without braces).- Parameters:
taggedValues
- collection of taggedValuestextParams
- configuration that defines what to include in the text of a slotseparator
- symbol(s) to separate each slot's text withbuilderFactory
- providesTextBuilder
to append created text to- Returns:
- builder with the taggedValues text appended
-
createTaggedValueText
public static TextBuilder createTaggedValueText(TaggedValue taggedValue, TaggedValueTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of the given taggedValue.- Parameters:
taggedValue
- element to create representation text fortextParams
- configuration that defines what to include in the text of a taggedValuebuilderFactory
- providesTextBuilder
to append created text to- Returns:
- builder with the taggedValue's text appended
-
createTaggedValueText
public static TextBuilder createTaggedValueText(TaggedValue taggedValue, TaggedValueTextParams textParams, java.util.function.Supplier<TextBuilder> builderFactory, RepTextContext context)
Creates string representation of the given taggedValue.- Parameters:
taggedValue
- element to create representation text fortextParams
- configuration that defines what to include in the text of a taggedValuebuilderFactory
- providesTextBuilder
to append created text to- Returns:
- builder with the taggedValue's text appended
-
appendTaggedValueValues
private static boolean appendTaggedValueValues(TaggedValue taggedValue, TaggedValueTextParams textParams, TextBuilder builder, RepTextContext context)
-
getTaggedValueValues
private static java.util.List<?> getTaggedValueValues(TaggedValue taggedValue, TaggedValueTextParams textParams)
-
taggedValueValueToStrings
private static RawTextBuilder taggedValueValueToStrings(TaggedValueTextParams textParams, java.lang.Object value, RepTextContext context)
-
getTaggedValueDefinitionName
@CheckForNull private static java.lang.String getTaggedValueDefinitionName(TaggedValue taggedValue, TaggedValueTextParams textParams)
-
appendTaggedValueDerivedSign
private static void appendTaggedValueDerivedSign(TaggedValue taggedValue, TaggedValueTextParams textParams, TextBuilder builder)
-
createTaggedValuesTextWithBraces
public static TextBuilder createTaggedValuesTextWithBraces(java.util.Collection<TaggedValue> taggedValues, TaggedValueTextParams textParams, java.lang.String separator, java.util.function.Supplier<TextBuilder> builderFactory)
Creates string representation of given taggedValues collection, wrapped between '{' and '}'.- Parameters:
taggedValues
- collection of taggedValuestextParams
- configuration that defines what to include in the text of a slotseparator
- symbol(s) to separate each slot's text withbuilderFactory
- providesTextBuilder
to append created text to- Returns:
- builder with the taggedValues text appended
-
getRepText
private static java.lang.String getRepText(Element element, com.nomagic.magicdraw.uml.text.RepTextParams params, RepTextContext context)
-
-