summaryrefslogtreecommitdiff
path: root/src/plugins/preflighting.core/schema/checker.exsd
blob: 90ee6ab8279f11b4b22287ab66108639dc3235cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="com.motorolamobility.preflighting.core" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
      <appinfo>
         <meta.schema plugin="com.motorolamobility.preflighting.core" id="checker" name="Checker"/>
      </appinfo>
      <documentation>
         This extension point provides means to create a checker for the App Validator. Checkers allow you to make verifications in either your Android Project or Android Application Packages (APKs).
      </documentation>
   </annotation>

   <element name="extension">
      <annotation>
         <appinfo>
            <meta.element />
         </appinfo>
      </annotation>
      <complexType>
         <sequence minOccurs="1" maxOccurs="unbounded">
            <element ref="checker"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="checker">
      <annotation>
         <documentation>
            This extension point provides the developer with all the basic structures needed for creating a Checker. 
The checker architecture supposes a hierarchy of conditions lying below every checker, giving meaningful results divided by the conditions class.
         </documentation>
      </annotation>
      <complexType>
         <sequence minOccurs="0" maxOccurs="unbounded">
            <element ref="condition"/>
            <element ref="parameter"/>
         </sequence>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  This is the Checker Id.
Don&apos;t use &quot;.&quot; as part of the id since it is used to specify conditions in the command line (checker.condition).
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  This is the checker name. It would preferably be a translatable value.
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string" use="required">
            <annotation>
               <documentation>
                  A short description of your checker.
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="class" type="string">
            <annotation>
               <documentation>
                  The class where the checker is implemented. If none is provided, the default class will be used, which is com.motorolamobility.preflighting.core.checker.Checker. 
                  In case one wishes to customize a checker, simply implement a new com.motorolamobility.preflighting.core.checker.IChecker
                  as required by this extension-point, or extend the default class. You can implement your own checker class if you need to compute something that is common to more than one condition, for example.
               </documentation>
               <appinfo>
                  <meta.attribute kind="java" basedOn="com.motorolamobility.preflighting.core.checker.Checker:com.motorolamobility.preflighting.core.checker.IChecker"/>
               </appinfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="condition">
      <annotation>
         <documentation>
            This is the extension point which provides all the necessary interfaces to the developer in order to create a checker condition, a prerequisite for the checker archtecture.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  The condition ID.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  The condition name.
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string" use="required">
            <annotation>
               <documentation>
                  A short description about the condition.
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="defaultSeverityLevel" use="required">
            <annotation>
               <documentation>
                  The default severity level of your condition. There are 4 valid values for this field:

- WARNING: Will rise a warning;
- ERROR: Wil rise a non-critical error;
- FATAL: will rise a fatal error, usually employed to denote a critical failure.
               </documentation>
            </annotation>
            <simpleType>
               <restriction base="string">
                  <enumeration value="WARNING">
                  </enumeration>
                  <enumeration value="ERROR">
                  </enumeration>
                  <enumeration value="FATAL">
                  </enumeration>
               </restriction>
            </simpleType>
         </attribute>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  The class where the condition is implemented. The actual application verification should be done here, and not in the Checker classes.
                  There is a default implementation of the Condition at com.motorolamobility.preflighting.core.checker.condition.Condition. It does some
                  basic tasks such as holding elements of the Condition (Id, Description and so on...). So, when defining the class which implements this extention-point, 
                  one could also make this class extend com.motorolamobility.preflighting.core.checker.condition.Condition. Thus, one only has to implement the abstract methods
                  of the default class com.motorolamobility.preflighting.core.checker.condition.Condition which actually do the work.
               </documentation>
               <appinfo>
                  <meta.attribute kind="java" basedOn="com.motorolamobility.preflighting.core.checker.condition.Condition:com.motorolamobility.preflighting.core.checker.condition.ICondition"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="markerType" type="string">
            <annotation>
               <documentation>
                  The marker type is used by problems view and editor to distinguish the markers. If the condition being defined provides a quick fix, then it should set its own markerType. Otherwise, use the default value.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="parameter">
      <annotation>
         <documentation>
            This is the extension point which provides a parameter to a checker
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  The checker parameter ID.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  The checker parameter name.
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string" use="required">
            <annotation>
               <documentation>
                  A short description about the chekcer parameter.
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="valueDescription" type="string" use="required">
            <annotation>
               <documentation>
                  A short value-description about the chekcer parameter.
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="isMandatory" type="boolean" use="required">
            <annotation>
               <documentation>
                  This flag determines whether this checker parameter is mandatory.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="type" use="required">
            <annotation>
               <documentation>
                  This fields defines the types of this parameter.
               </documentation>
            </annotation>
            <simpleType>
               <restriction base="string">
                  <enumeration value="STRING">
                  </enumeration>
                  <enumeration value="BOOLEAN">
                  </enumeration>
                  <enumeration value="INTEGER">
                  </enumeration>
               </restriction>
            </simpleType>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appinfo>
         <meta.section type="since"/>
      </appinfo>
      <documentation>
         1.0.0
      </documentation>
   </annotation>

   <annotation>
      <appinfo>
         <meta.section type="examples"/>
      </appinfo>
      <documentation>
         &lt;p&gt;The plugin &lt;code&gt;preflighting.samplechecker.androidlabel&lt;/code&gt; distributed in the App Validator SDK contains an example on how to implement a Condition that accepts a parameter.&lt;/p&gt;

&lt;p&gt;The plugin &lt;code&gt;preflighting.samplecheckers.findviewbyid&lt;/code&gt; shows how to implement a Condition available only for projects (not for APKs). It also serves as an example about how to analyse Android (Java code) by using App Validator SDK framework.&lt;/p&gt;
      </documentation>
   </annotation>

   <annotation>
      <appinfo>
         <meta.section type="apiinfo"/>
      </appinfo>
      <documentation>
         You can access App Validator SDK API, by browsing the javadoc of the most important classes in the framework &lt;code&gt;Checker&lt;/code&gt;, &lt;code&gt;Condition&lt;/code&gt;, &lt;code&gt;ApplicationData&lt;/code&gt;, &lt;code&gt; CanExecuteConditionStatus&lt;/code&gt;, &lt;code&gt;PlatformRules&lt;/code&gt;, &lt;/code&gt;ValidationResult&lt;/code&gt; .
      </documentation>
   </annotation>

   <annotation>
      <appinfo>
         <meta.section type="implementation"/>
      </appinfo>
      <documentation>
         &lt;p&gt;&lt;code&gt;Checker&lt;/code&gt; is an utility class available in the App Validator SDK that implements &lt;code&gt;IChecker&lt;/code&gt;. If checker does not contain any special parameter validation, developers may indicate com.motorolamobility.preflighting.core.checker in the extension point.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Condition&lt;/code&gt; is an utility class available in the App Validator SDK that implements &lt;code&gt;ICondition&lt;/code&gt;. Developers may use &lt;code&gt;Condition&lt;/code&gt; as a base class to inherit the most common operations for code analysis.&lt;/p&gt;
      </documentation>
   </annotation>

   <annotation>
      <appinfo>
         <meta.section type="copyright"/>
      </appinfo>
      <documentation>
         Copyright (C) 2012 The Android Open Source Project
      </documentation>
   </annotation>

</schema>