uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

Tracing Methods

Tracing non api methods is possible using MOTL. Entry and/or exit of methods can be traced.

  • Method Entry: trace code is injected at the method entry.
  • Method Exit: trace code is injected at method exit before return statements if exits.

Example

// this example shows how to trace non api method entry

class JavaMethod
{
  trace method();
    
  int method( int x ) {
    x += 5;
    return x;
  }
}


      

Load the above code into UmpleOnline

 

Another Example

// this example shows how to trace non api method exit
// incase of methods with return statement, trace code is 
// injected before the return

class JavaMethod
{
  trace exit method();
    
  int method( int x ) {
    x += 5;
    return x;
  }
}


      

Load the above code into UmpleOnline

 

Syntax


traceDirective : trace [[Prefix]]? [[traceEntity]] [[Postfix]] ;