1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
5
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
6
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
7
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
9
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
10
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
11
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
12
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
13
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
14
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
15
|
|
|
* |
16
|
|
|
* This software consists of voluntary contributions made by many individuals |
17
|
|
|
* and is licensed under the LGPL. For more information please see |
18
|
|
|
* <http://phing.info>. |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace Phing\Filter; |
22
|
|
|
|
23
|
|
|
use Phing\Util\RegisterSlot; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Class that holds an XSLT parameter. |
27
|
|
|
*/ |
28
|
|
|
class XsltParam |
29
|
|
|
{ |
30
|
|
|
private $name; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var RegisterSlot|string |
34
|
|
|
*/ |
35
|
|
|
private $expr; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Sets param name. |
39
|
|
|
* |
40
|
|
|
* @param string $name |
41
|
|
|
*/ |
42
|
|
|
public function setName($name) |
43
|
|
|
{ |
44
|
|
|
$this->name = $name; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Get param name. |
49
|
|
|
* |
50
|
|
|
* @return string |
51
|
|
|
*/ |
52
|
|
|
public function getName() |
53
|
|
|
{ |
54
|
|
|
return $this->name; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Sets expression value (alias to the setExpression()) method. |
59
|
|
|
* |
60
|
|
|
* @param string $v |
61
|
|
|
* |
62
|
|
|
* @see setExpression() |
63
|
|
|
*/ |
64
|
|
|
public function setValue($v) |
65
|
|
|
{ |
66
|
|
|
$this->setExpression($v); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Gets expression value (alias to the getExpression()) method. |
71
|
|
|
* |
72
|
|
|
* @return string |
73
|
|
|
* |
74
|
|
|
* @see getExpression() |
75
|
|
|
*/ |
76
|
|
|
public function getValue() |
77
|
|
|
{ |
78
|
|
|
return $this->getExpression(); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Sets expression value. |
83
|
|
|
* |
84
|
|
|
* @param string $expr |
85
|
|
|
*/ |
86
|
|
|
public function setExpression($expr) |
87
|
|
|
{ |
88
|
|
|
$this->expr = $expr; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Sets expression to dynamic register slot. |
93
|
|
|
*/ |
94
|
|
|
public function setListeningExpression(RegisterSlot $expr) |
95
|
|
|
{ |
96
|
|
|
$this->expr = $expr; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Returns expression value -- performs lookup if expr is registerslot. |
101
|
|
|
* |
102
|
|
|
* @return string |
103
|
|
|
*/ |
104
|
|
|
public function getExpression() |
105
|
|
|
{ |
106
|
|
|
if ($this->expr instanceof RegisterSlot) { |
107
|
|
|
return $this->expr->getValue(); |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
return $this->expr; |
111
|
|
|
} |
112
|
|
|
} |
113
|
|
|
|