Does anyone know, how to do the quickfix to add unimplemented methods from an Interface with Xtend code ?
Asked
Active
Viewed 305 times
1 Answers
0
I assume you have an interface MyInterface
that declares a method void aMethod()
and a class ImplementingClass implements MyInterface
and you want to know the syntax to implement aMethod()
.
Using Xtend's ProposalProvider in Eclipse provides either to implement the unimplemented methods or to make ImplementingClass
abstract.
Using the Add unimplemented methods proposal the overriding method will be automatically generated for you. ImplementingClass
then looks like this:
class ImplementingClass implements MyInterface {
override aMethod() {
throw new UnsupportedOperationException("TODO: auto-generated method stub")
}
}
As you can see, Xtend has a special keyword overrides
to define a method that override an other method. It is used instead of the regular def
keyword to define methods.
Simply remove the throw ...
expression and implement the moethod.

Joko
- 600
- 3
- 15