Class UML 2.4.1::StringExpression
Description:
An expression that specifies a string value that is derived by concatenating
a set of sub string expressions, some of which might be template parameters.
Direct Superclasses: Expression,
TemplateableElementDirect Subclasses: Class Precedence List: StringExpression,
Expression,
ValueSpecification,
TypedElement,
PackageableElement,
ParameterableElement,
NamedElement,
TemplateableElement,
ElementProperties:
owningExpression :
StringExpression (0 1); -- source
StringExpression subExpression :
StringExpression (0 *); -- source
StringExpression operand :
ValueSpecification (0 *); -- source
Expression symbol : String (0 1); -- source
Expression type :
Type (0 1); -- source
TypedElement visibility :
VisibilityKind (1 1); -- source
PackageableElement owningTemplateParameter :
TemplateParameter (0 1); -- source
ParameterableElement templateParameter :
TemplateParameter (0 1); -- source
ParameterableElement clientDependency :
Dependency (0 *); -- source
NamedElement name : String (0 1); -- source
NamedElement nameExpression :
StringExpression (0 1); -- source
NamedElement namespace :
Namespace (0 1); -- source
NamedElement qualifiedName : String (0 1); -- source
NamedElement ownedTemplateSignature :
TemplateSignature (0 1); -- source
TemplateableElement templateBinding :
TemplateBinding (0 *); -- source
TemplateableElement ownedComment :
Comment (0 *); -- source
Element ownedElement :
Element (0 *); -- source
Element owner :
Element (0 1); -- source
ElementThe Element that owns this element.
{
readonly}
Derived union with sources: (namespace, owningTemplateParameter, owningExpression)
Opposite: Element.ownedElement
Constraints:
Signature: subexpressions() : Boolean;
Description: If a StringExpression has sub-expressions, it cannot have operands and
vice versa (this avoids the problem of having to define a collating sequence
between operands and subexpressions).
The OCL used here is not normative.Editor's notes: missing endif
Expression: if subExpression->notEmpty() then operand->isEmpty() else operand->notEmpty() endif
Original: if subExpression->notEmpty() then operand->isEmpty() else operand->notEmpty()
Signature: operands() : Boolean;
Description: All the operands of a StringExpression must be LiteralStrings
Expression: operand->forAll (op | op.oclIsKindOf (LiteralString))
Operations:
Signature: stringValue() : String;
Description: The query stringValue() returns the string that concatenates, in order,
all the component string literals of all the subexpressions that are part
of the StringExpression.
The OCL used here is not normative.Editor's notes: iterate not iterate().
Expression: result = if subExpression->notEmpty()
then subExpression->iterate(se; stringValue = '' | stringValue.concat(se.stringValue()))
else operand->iterate(op; stringValue = '' | stringValue.concat(op.value)) endif
Original: result = if subExpression->notEmpty() then subExpression->iterate(se; stringValue = | stringValue.concat(se.stringValue())) else operand->iterate()(op; stringValue = | stringValue.concat(op.value))
Send questions or comments to
[email protected].