Added
Link Here
|
1 |
public aspect UIDEntityManagementAspect { |
2 |
|
3 |
public pointcut entityAccessor1(CommonEntity entity) |
4 |
: execution(* CommonEntity*(..)) |
5 |
&& args(entity) && if(entity != null); |
6 |
|
7 |
public pointcut entityAccessor2(CommonEntity entity) |
8 |
: execution(ManageEntity.new(CommonEntity+, ..)) |
9 |
&& within(ManageEntity) |
10 |
&& args(entity, ..) |
11 |
&& if(entity != null); |
12 |
|
13 |
public pointcut entityAccessor(CommonEntity entity) |
14 |
: entityAccessor1(entity) || entityAccessor2(entity); |
15 |
|
16 |
declare parents: Entity implements CommonEntity; |
17 |
|
18 |
before(CommonEntity entity) : entityAccessor(entity) { |
19 |
} |
20 |
|
21 |
} |