Strictness Directive
Directives
noreferences
@@tooltip Control Umple's compiler in various ways, such as suppressing unwanted warnings

@@description
<p>
The strictness directive is used to control certain messages that the Umple compiler may issue. It has five subdirectives that are specified by a second keyword following &#39;strictness&#39;:
</p>

<p>
The first two are &#39;modelOnly&#39; or &#39;noExtraCode&#39;. These are used when the programmer or modeller intends not to include base language code, and wants a warning to appear if base language code is found. Base language code is code in a language like Java or PhP that is discovered by Umple but not interpreted in any way. One example is the code in the bodies of methods; however, when parsing a class, any time Umple can&#39;t parse what it finds, it assumes it must be base language code. It just emits the base language code for the base language compiler to deal with. However there are circumstances when the developer does not want this: The developer may be creating a pure model or may want that the only base language code would be in the body of methods. It is advantageous therefore to tell the compiler to raise a warning if it thinks it has found base language code in some other context, since otherwise, an ordinary Umple syntax error may go undetected, until the base language compiler is run on the code.</p>
<ul>
<li><b>strictness modelOnly;</b> means be very strict and issue a warning if base language code is found.</li>
<li><b>strictness noExtraCode;</b> means that base language code is allowed in method bodies, but if found anywhere else to issue a warning.</li>
</ul>
</p>

<p>
The second set of subdirectives are &#39;expect&#39;, &#39;allow&#39; and &#39;disallow&#39;. These are used to control the effect of certain messages. They are followed by a message number.

<ul>

<li><b>strictness expect n</b> declares that message number n <i>should occur</i>; it is an error if the message does not. This is used in testing to create example cases of message n; an error would be triggered if message n does <i>not</i> appear.

<li><b>strictness allow n</b> is used in the case of errors, to tell the compiler to not actually &#39;fail&#39;, but to report that error as if it was a warning. In the case of n being a warning, the warning is not emitted. This is also used in testing to include cases that give message n, without the compiler reporting that it has failed.

<li><b>strictness disallow n</b>, where n is a warning, tells the compiler to treat n as if it was an error, and fail the compilation.


</ul>
<em>Some of the above are still under development.</em>
</p>

<p>
The strictness directives take effect on the entire system being built.
The code of all Ump files of that system will be subject to the strictness
subdirectives.
</p>

@@syntax
[[strictness]] [[strictnessMessage]] [[strictnessDisableAuto]] 

@@example
@@source manualexamples/StrictnessDirective1.ump
@@endexample
