Freigeben über


2.1.34 ValueAnnotation

ValueAnnotation is used to attach a named value to a model element.

The following is an example of the ValueAnnotation element.

 <ValueAnnotation Term="Title" String="MyTitle" />
 <ValueAnnotation Term="ReadOnly" />

The following rules apply to the ValueAnnotation element:

  • The ValueAnnotation element MUST have a Term attribute defined that is a namespace qualified name, alias qualified name, or SimpleIdentifier.

  • The ValueAnnotation can appear only as a child element of the following elements:

  • ValueAnnotation can have a Qualifier attribute defined unless the ValueAnnotation is a child element of an Annotations element that has a Qualifier attribute defined. If a Qualifier is defined, it has to be a SimpleIdentifier. Qualifier is used to differentiate bindings based on external context.

  • A ValueAnnotation can specify an expression as a child element or as an expression attribute that gives the value of the term.

  • A ValueAnnotation can have one of the following attributes defined in place of a child element expression. Each of these is equivalent to the same-named expression with the equivalent spelling:

    • Path

    • String

    • Int

    • Float

    • Decimal

    • Bool

    • DateTime

  • If a ValueAnnotation has neither a child expression nor an attribute specifying a value, the value of the annotation is the DefaultValue specified for the annotation, or Null if no DefaultValue is specified. Note that a Null value for a term is distinct from the absence of a ValueAnnotation element for that term, in which case the term has no value.