Get the name of a class and method as a string

Viewed 43

To get the name of a project as a string I can use:

loc project = |project://Test/|;<br/>
str name = project.authority;

Is there something similar available for classes or methods?

I would like to write the contents of a class/method to disk and then use its name as the filename.

1 Answers

To answer my own question, I needed to use;

public void testcode( loc project){
M3 model = createM3FromEclipseProject(project);
for (loc l <- classes(model)) {
     println(l.path);
}

Sorry, didn't read the docs thoroughly.

Related