Do you know about a library that allows us to generate UI by just stating that it should be generated?

I think there must be a person who have implemented a mechanism allowing us to transform code like this:

```
class Main {
    @Command
    int add(int a, int b) {
        return a+b;
    }
}

```

into, say, a dialog with 2 text fields and a button? Or into a webform? You've got the idea, right?

The type of UI and the language doesn't matter, if it allows us to simply say, "This should be a command" without those lots of XML files scattered all over the application.

And, btw, what do you think about this kind of meta-programming?