1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* \AppserverIo\Doppelgaenger\Entities\Definitions\Pointcut |
5
|
|
|
* |
6
|
|
|
* NOTICE OF LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
9
|
|
|
* that is available through the world-wide-web at this URL: |
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
11
|
|
|
* |
12
|
|
|
* PHP version 5 |
13
|
|
|
* |
14
|
|
|
* @author Bernhard Wick <[email protected]> |
15
|
|
|
* @copyright 2015 TechDivision GmbH - <[email protected]> |
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
17
|
|
|
* @link https://github.com/appserver-io/doppelgaenger |
18
|
|
|
* @link http://www.appserver.io/ |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace AppserverIo\Doppelgaenger\Entities\Definitions; |
22
|
|
|
|
23
|
|
|
use AppserverIo\Doppelgaenger\Entities\PointcutExpression; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Definition class which represents a pointcut which got implemented as a referenceable piece of code within an advice |
27
|
|
|
* |
28
|
|
|
* @author Bernhard Wick <[email protected]> |
29
|
|
|
* @copyright 2015 TechDivision GmbH - <[email protected]> |
30
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
31
|
|
|
* @link https://github.com/appserver-io/doppelgaenger |
32
|
|
|
* @link http://www.appserver.io/ |
33
|
|
|
* |
34
|
|
|
* @property string $aspectName Name Name of the aspect the advice is defined in |
35
|
|
|
* @property string $name Name of function representing the pointcut within code |
36
|
|
|
* @property \AppserverIo\Doppelgaenger\Entities\PointcutExpression $pointcutExpression Expression defining the target of advices referencing this pointcut |
37
|
|
|
*/ |
38
|
|
|
class Pointcut |
39
|
|
|
{ |
40
|
|
|
/** |
41
|
|
|
* Name of the aspect the pointcut is defined in |
42
|
|
|
* |
43
|
|
|
* @var string $aspectName |
44
|
|
|
*/ |
45
|
|
|
protected $aspectName; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Name of function representing the pointcut within code |
49
|
|
|
* |
50
|
|
|
* @var string $name |
51
|
|
|
*/ |
52
|
|
|
protected $name; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Expression defining the target of advices referencing this pointcut |
56
|
|
|
* |
57
|
|
|
* @var \AppserverIo\Doppelgaenger\Entities\PointcutExpression $pointcutExpression |
58
|
|
|
*/ |
59
|
|
|
protected $pointcutExpression; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Getter for the $aspectName property |
63
|
|
|
* |
64
|
|
|
* @return string |
65
|
|
|
*/ |
66
|
|
|
public function getAspectName() |
67
|
|
|
{ |
68
|
|
|
return $this->aspectName; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Getter for the $name property |
73
|
|
|
* |
74
|
|
|
* @return string |
75
|
|
|
*/ |
76
|
|
|
public function getName() |
77
|
|
|
{ |
78
|
|
|
return $this->name; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Getter for the $pointcutExpression property |
83
|
|
|
* |
84
|
|
|
* @return \AppserverIo\Doppelgaenger\Entities\PointcutExpression |
85
|
|
|
*/ |
86
|
|
|
public function getPointcutExpression() |
87
|
|
|
{ |
88
|
|
|
return $this->pointcutExpression; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Will return the qualified name of an pointcut. |
93
|
|
|
* Will have the form or <CONTAINING ASPECT>-><POINTCUT NAME> |
94
|
|
|
* |
95
|
|
|
* @return string |
96
|
|
|
*/ |
97
|
|
View Code Duplication |
public function getQualifiedName() |
98
|
|
|
{ |
99
|
|
|
if (empty($this->aspectName)) { |
100
|
|
|
return $this->name; |
101
|
|
|
|
|
|
|
|
102
|
|
|
} else { |
103
|
|
|
return $this->aspectName . '->' . $this->name; |
104
|
|
|
} |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Setter for the $aspectName property |
109
|
|
|
* |
110
|
|
|
* @param string $aspectName Name of the aspect the pointcut is defined in |
111
|
|
|
* |
112
|
|
|
* @return null |
113
|
|
|
*/ |
114
|
|
|
public function setAspectName($aspectName) |
115
|
|
|
{ |
116
|
|
|
$this->aspectName = $aspectName; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* Setter for the $name property |
121
|
|
|
* |
122
|
|
|
* @param string $name Name of the pointcut |
123
|
|
|
* |
124
|
|
|
* @return null |
125
|
|
|
*/ |
126
|
|
|
public function setName($name) |
127
|
|
|
{ |
128
|
|
|
$this->name = $name; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* Setter for the $pointcutExpression property |
133
|
|
|
* |
134
|
|
|
* @param \AppserverIo\Doppelgaenger\Entities\PointcutExpression $pointcutExpression Expression defining the target |
135
|
|
|
* |
136
|
|
|
* @return null |
137
|
|
|
*/ |
138
|
|
|
public function setPointcutExpression(PointcutExpression $pointcutExpression) |
139
|
|
|
{ |
140
|
|
|
$this->pointcutExpression = $pointcutExpression; |
141
|
|
|
} |
142
|
|
|
} |
143
|
|
|
|