Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Getting the reference to an annotated class

Hi,
 
         I am setting the reference to another class in PersonalDetail when it is constructed like this.
 
 after( PersonalDetail p ) : execution ( public PersonalDetail .new(..) )
                                                  && this( p ){
  System.out.println(thisJoinPoint.getSignature().toString());
  p.setDao( DAOFactory.getDAOFactory( 2 ).getAddressDAO() );
 }
 
 
Is there any way to remove the reference to PersonalDetail completely from this pointcut definition ?
 
I tried (@Entity is the annotation)
 
after( Entity e ) : execution ( * .new(..) )
                                                  && annotation( e ){
 .....
}
 
but could not write   thisJoinPoint.getThis().setDao( DAOFactory.getDAOFactory( 2 ).getAddressDAO() ); becuase thisJoinPoint.getThis()
returns an Object.
 
Thanks,
Mohan
 

Back to the top