Interface TextualRepresentation

All Superinterfaces:
AnnotatingElement, BaseElement, Cloneable, Comparable, Element, org.eclipse.emf.ecore.EObject, ModelElement, com.dassault_systemes.modeler.modelextension.model.modelextension.ModelExtensionObject, org.eclipse.emf.common.notify.Notifier

@OpenApiAll public interface TextualRepresentation extends AnnotatingElement

A TextualRepresentation is an AnnotatingElement whose body represents the representedElement in a given language. The representedElement must be the owner of the TextualRepresentation. The named language can be a natural language, in which case the body is an informal representation, or an artificial language, in which case the body is expected to be a formal, machine-parsable representation.

If the named language of a TextualRepresentation is machine-parsable, then the body text should be legal input text as defined for that language. The interpretation of the named language string shall be case insensitive. The following language names are defined to correspond to the given standard languages:

kerml Kernel Modeling Language
ocl Object Constraint Language
alf Action Language for fUML

Other specifications may define specific language strings, other than those shown above, to be used to indicate the use of languages from those specifications in KerML TextualRepresentation.

If the language of a TextualRepresentation is "kerml", then the body text shall be a legal representation of the representedElement in the KerML textual concrete syntax. A conforming tool can use such a TextualRepresentation Annotation to record the original KerML concrete syntax text from which an Element was parsed. In this case, it is a tool responsibility to ensure that the body of the TextualRepresentation remains correct (or the Annotation is removed) if the annotated Element changes other than by re-parsing the body text.

An Element with a TextualRepresentation in a language other than KerML is essentially a semantically "opaque" Element specified in the other language. However, a conforming KerML tool may interpret such an element consistently with the specification of the named language.

  • Method Details

    • getLanguage

      @CheckForNull String getLanguage()

      The natural or artifical language in which the body text is written.

      Returns:
      the language value
      Model:
      derived="false" transient="false"
    • setLanguage

      void setLanguage(@CheckForNull String value)

      The natural or artifical language in which the body text is written.

      Parameters:
      value - the language value
      Model:
      derived="false" transient="false"
    • getRepresentedElement

      @CheckForNull Element getRepresentedElement()

      The Element that is represented by this TextualRepresentation.

      Returns:
      the representedElement value
      Model:
      derived="true" transient="true" opposite=Element.getTextualRepresentation() subsets=Element.getOwner() redefines=AnnotatingElement.getAnnotatedElement()
    • getBody

      @CheckForNull String getBody()

      The textual representation of the representedElement in the given language.

      Returns:
      the body value
      Model:
      derived="false" transient="false"
    • setBody

      void setBody(@CheckForNull String value)

      The textual representation of the representedElement in the given language.

      Parameters:
      value - the body value
      Model:
      derived="false" transient="false"