1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* Copyright (c) Nate Brunette. |
4
|
|
|
* Distributed under the MIT License (http://opensource.org/licenses/MIT) |
5
|
|
|
*/ |
6
|
|
|
namespace Tebru\Gson; |
7
|
|
|
|
8
|
|
|
use Tebru\Gson\Internal\Data\AnnotationSet; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Interface PropertyMetadata |
12
|
|
|
* |
13
|
|
|
* Represents a property and its annotations |
14
|
|
|
* |
15
|
|
|
* @author Nate Brunette <[email protected]> |
16
|
|
|
*/ |
17
|
|
|
interface PropertyMetadata |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* Get the property name |
21
|
|
|
* |
22
|
|
|
* @return string |
23
|
|
|
*/ |
24
|
|
|
public function getName(): string; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Get the property serialized name |
28
|
|
|
* |
29
|
|
|
* @return string |
30
|
|
|
*/ |
31
|
|
|
public function getSerializedName(): string; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Get the full php type object |
35
|
|
|
* |
36
|
|
|
* @return PhpType |
37
|
|
|
*/ |
38
|
|
|
public function getType(): PhpType; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Get the property type as a string |
42
|
|
|
* |
43
|
|
|
* @return string |
44
|
|
|
*/ |
45
|
|
|
public function getTypeName(): string; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Get the property modifiers as a bitmap of [@see \ReflectionProperty] constants |
49
|
|
|
* |
50
|
|
|
* @return int |
51
|
|
|
*/ |
52
|
|
|
public function getModifiers(): int; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Get full declaring class metadata |
56
|
|
|
* |
57
|
|
|
* @return ClassMetadata |
58
|
|
|
*/ |
59
|
|
|
public function getDeclaringClassMetadata(): ClassMetadata; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Get the declaring class name |
63
|
|
|
* |
64
|
|
|
* @return string |
65
|
|
|
*/ |
66
|
|
|
public function getDeclaringClassName(): string; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Get property annotations |
70
|
|
|
* |
71
|
|
|
* @return AnnotationSet |
72
|
|
|
*/ |
73
|
|
|
public function getAnnotations(): AnnotationSet; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Get a single annotation, returns null if the annotation doesn't exist |
77
|
|
|
* |
78
|
|
|
* @param string $annotationName |
79
|
|
|
* @return null|object |
80
|
|
|
*/ |
81
|
|
|
public function getAnnotation(string $annotationName); |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Returns true if the property is virtual |
85
|
|
|
* |
86
|
|
|
* @return bool |
87
|
|
|
*/ |
88
|
|
|
public function isVirtual(): bool; |
89
|
|
|
} |
90
|
|
|
|