Software Disclaimer

Class UML 2.3::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, TemplateableElement

Direct Subclasses:

Class Precedence List: StringExpression, Expression, ValueSpecification, PackageableElement, ParameterableElement, TypedElement, NamedElement, TemplateableElement, Element

Properties:

owningExpression : StringExpression (0 1); -- source StringExpression
subExpression : StringExpression (0 *); -- source StringExpression
operand : ValueSpecification (0 *); -- source Expression
symbol : String (0 1); -- source Expression
visibility : VisibilityKind (1 1); -- source PackageableElement
owningTemplateParameter : TemplateParameter (0 1); -- source ParameterableElement
templateParameter : TemplateParameter (0 1); -- source ParameterableElement
type : Type (0 1); -- source TypedElement
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

The Comments owned by this element.
{composite}
Subsets: Element.ownedElement

ownedElement : Element (0 *); -- source Element
owner : Element (0 1); -- source Element

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].