1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* AppserverIo\Psr\EnterpriseBeans\Annotations\Inject |
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 Tim Wagner <[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-psr/apb |
18
|
|
|
* @link http://www.appserver.io |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace AppserverIo\Psr\EnterpriseBeans\Annotations; |
22
|
|
|
|
23
|
|
|
use AppserverIo\Lang\Reflection\ReflectionAnnotation; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Annotation implementation representing a @Inject annotation on a class method/property. |
27
|
|
|
* |
28
|
|
|
* @author Tim Wagner <[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-psr/epb |
32
|
|
|
* @link http://www.appserver.io |
33
|
|
|
*/ |
34
|
|
|
class Inject extends ReflectionAnnotation |
35
|
|
|
{ |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* The annotation for a default timeout method. |
39
|
|
|
* |
40
|
|
|
* @var string |
41
|
|
|
*/ |
42
|
|
|
const ANNOTATION = 'Inject'; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* This method returns the class name as |
46
|
|
|
* a string. |
47
|
|
|
* |
48
|
|
|
* @return string |
49
|
|
|
*/ |
50
|
|
|
public static function __getClass() |
51
|
|
|
{ |
52
|
|
|
return __CLASS__; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Returns the value of the name attribute. |
57
|
|
|
* |
58
|
|
|
* @return string|null The annotations name attribute |
59
|
|
|
*/ |
60
|
|
|
public function getName() |
61
|
|
|
{ |
62
|
|
|
if (isset($this->values[AnnotationKeys::NAME])) { |
63
|
|
|
return $this->values[AnnotationKeys::NAME]; |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Returns the value of the bean name attribute. |
69
|
|
|
* |
70
|
|
|
* @return string|null The annotations bean Name attribute |
71
|
|
|
*/ |
72
|
|
|
public function getBeanName() |
73
|
|
|
{ |
74
|
|
|
if (isset($this->values[AnnotationKeys::BEAN_NAME])) { |
75
|
|
|
return $this->values[AnnotationKeys::BEAN_NAME]; |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Returns the value of the description attribute. |
81
|
|
|
* |
82
|
|
|
* @return string|null The annotations description attribute |
83
|
|
|
*/ |
84
|
|
|
public function getDescription() |
85
|
|
|
{ |
86
|
|
|
if (isset($this->values[AnnotationKeys::DESCRIPTION])) { |
87
|
|
|
return $this->values[AnnotationKeys::DESCRIPTION]; |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Returns the value of the type attribute. |
93
|
|
|
* |
94
|
|
|
* @return string The annotations type attribute |
95
|
|
|
*/ |
96
|
|
|
public function getType() |
97
|
|
|
{ |
98
|
|
|
if (isset($this->values[AnnotationKeys::TYPE])) { |
99
|
|
|
return $this->values[AnnotationKeys::TYPE]; |
100
|
|
|
} |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Returns the value of the factory attribute. |
105
|
|
|
* |
106
|
|
|
* @return string The annotations factory attribute |
107
|
|
|
*/ |
108
|
|
|
public function getFactory() |
109
|
|
|
{ |
110
|
|
|
if (isset($this->values[AnnotationKeys::FACTORY])) { |
111
|
|
|
return $this->values[AnnotationKeys::FACTORY]; |
112
|
|
|
} |
113
|
|
|
} |
114
|
|
|
} |
115
|
|
|
|