1
|
1 |
"{ Package: 'stx:goodies/metacello' }"
|
|
2 |
|
|
3 |
Object subclass:#MetacelloValidationIssue
|
|
4 |
instanceVariableNames:'configurationClass explanation reasonCode callSite'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Metacello-Core-Validation'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MetacelloValidationIssue class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
configurationClass: aClass reasonCode: aSymbol callSite: aCallSite explanation: aString
|
|
14 |
|
|
15 |
^(self new)
|
|
16 |
configurationClass: aClass;
|
|
17 |
reasonCode: aSymbol;
|
|
18 |
callSite: aCallSite;
|
|
19 |
explanation: aString;
|
|
20 |
yourself
|
|
21 |
! !
|
|
22 |
|
|
23 |
!MetacelloValidationIssue methodsFor:'accessing'!
|
|
24 |
|
|
25 |
callSite
|
|
26 |
^ callSite
|
|
27 |
!
|
|
28 |
|
|
29 |
callSite: anObject
|
|
30 |
callSite := anObject
|
|
31 |
!
|
|
32 |
|
|
33 |
configurationClass
|
|
34 |
^ configurationClass
|
|
35 |
!
|
|
36 |
|
|
37 |
configurationClass: aClass
|
|
38 |
configurationClass := aClass
|
|
39 |
!
|
|
40 |
|
|
41 |
explanation
|
|
42 |
^ explanation
|
|
43 |
!
|
|
44 |
|
|
45 |
explanation: aString
|
|
46 |
explanation := aString
|
|
47 |
!
|
|
48 |
|
|
49 |
label
|
|
50 |
|
|
51 |
^''
|
|
52 |
!
|
|
53 |
|
|
54 |
reasonCode
|
|
55 |
|
|
56 |
reasonCode == nil ifTrue: [ reasonCode := #none ].
|
|
57 |
^ reasonCode
|
|
58 |
!
|
|
59 |
|
|
60 |
reasonCode: anObject
|
|
61 |
reasonCode := anObject
|
|
62 |
! !
|
|
63 |
|
|
64 |
!MetacelloValidationIssue methodsFor:'printing'!
|
|
65 |
|
|
66 |
printOn: aStream
|
|
67 |
aStream
|
|
68 |
nextPutAll: self label;
|
|
69 |
nextPut: $:;
|
|
70 |
space;
|
|
71 |
nextPutAll: self explanation.
|
|
72 |
self reasonCode ~~ #none
|
|
73 |
ifTrue: [
|
|
74 |
aStream
|
|
75 |
space;
|
|
76 |
nextPut: ${;
|
|
77 |
space;
|
|
78 |
nextPutAll: self reasonCode asString;
|
|
79 |
space;
|
|
80 |
nextPut: $} ].
|
|
81 |
(self configurationClass ~~ nil or: [ self callSite ~~ nil ])
|
|
82 |
ifTrue: [
|
|
83 |
aStream
|
|
84 |
space;
|
|
85 |
nextPut: $[;
|
|
86 |
space.
|
|
87 |
self configurationClass ~~ nil
|
|
88 |
ifTrue: [
|
|
89 |
aStream
|
|
90 |
nextPutAll: self configurationClass name asString;
|
|
91 |
space ].
|
|
92 |
self callSite ~~ nil
|
|
93 |
ifTrue: [
|
|
94 |
aStream
|
|
95 |
nextPutAll: self callSite name asString;
|
|
96 |
space ].
|
|
97 |
aStream nextPut: $] ]
|
|
98 |
! !
|
|
99 |
|
|
100 |
!MetacelloValidationIssue methodsFor:'testing'!
|
|
101 |
|
|
102 |
isCritical
|
|
103 |
|
|
104 |
^self isError or: [ self isCriticalWarning ]
|
|
105 |
!
|
|
106 |
|
|
107 |
isCriticalWarning
|
|
108 |
|
|
109 |
^false
|
|
110 |
!
|
|
111 |
|
|
112 |
isError
|
|
113 |
|
|
114 |
^false
|
|
115 |
!
|
|
116 |
|
|
117 |
isWarning
|
|
118 |
|
|
119 |
^false
|
|
120 |
! !
|
|
121 |
|
|
122 |
!MetacelloValidationIssue class methodsFor:'documentation'!
|
|
123 |
|
|
124 |
version_SVN
|
|
125 |
^ '$Id:: $'
|
|
126 |
! !
|