Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » inject default constructor and round it
inject default constructor and round it [message #590375] Thu, 13 October 2005 10:43
Maciej is currently offline MaciejFriend
Messages: 2
Registered: July 2009
Junior Member
Hi, here is my problem:
I have interface which does not have default constructor.

public class NotYetABean {
public NotYetABean(Long id) {}

public class Factory {
public NotYetABean newInstance() { }

I want to add default constructor and then around default constructor
I would like to return Factory.newInstance() instead of call to
default constructor. Is it possible?

I tried:
aspect ConstructorInjection {
public NotYetABean() { this(new Long(1); }
NotYetABean around(): call( {
return Factory.newInstance();

but it does not work, default constructor is added but around-code is
not called.

Is it possible to write such aspect?

Thank you for any help.

Previous Topic:AspectJ 5 M4
Next Topic:Converting Existing Maven Project to use AspectJ?
Goto Forum:

Current Time: Tue Jun 19 05:12:28 GMT 2018

Powered by FUDForum. Page generated in 0.02111 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top