RFE: Introduce Decorated Class

How about a refactoring that will create a decorated class based on an existing supplied interface/class :

for example:

Id like to make a decorated Statement :

public class MyStatement implements Statement
{
private Statement statement;

public ResultSet executeQuery()
{
return statement.executeQuery();
}
...
...
}

This could easily be automated - as it is now, its a pain in the neck, especially when IDEA can already create all the interface methods, but it creates them with "default" return values - it woiuld be nice if the "implement interface" refactoring could be told to delegate all calls to the data member.

2 comments
Comment actions Permalink

Im aware of the "Delegate Methods..." refactoring in the code menu - what I was getting at was enhancing the "Implement Interface" functionality with a new option like "Implement Decorator"

0
Comment actions Permalink

Nick

>How about a refactoring that will create a decorated class based on an existing supplied interface/class :
>

>

Feel free to vote for:
"create a wrapper"
http://www.jetbrains.net/jira/browse/IDEABKL-2931?page=all


In the meantime, use
Code.Delegate Methods
(and NOT Refactoring.xxx)

It does most ot the work, in a snap.

Alain


0

Please sign in to leave a comment.