~ubuntu-branches/ubuntu/saucy/ivy/saucy-proposed

« back to all changes in this revision

Viewing changes to src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-05-15 17:44:57 UTC
  • mfrom: (3.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130515174457-ogntd0vxluwalq11
Tags: 2.3.0-2
* Team upload.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 
3
 *  contributor license agreements.  See the NOTICE file distributed with
 
4
 *  this work for additional information regarding copyright ownership.
 
5
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 
6
 *  (the "License"); you may not use this file except in compliance with
 
7
 *  the License.  You may obtain a copy of the License at
 
8
 *
 
9
 *      http://www.apache.org/licenses/LICENSE-2.0
 
10
 *
 
11
 *  Unless required by applicable law or agreed to in writing, software
 
12
 *  distributed under the License is distributed on an "AS IS" BASIS,
 
13
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
14
 *  See the License for the specific language governing permissions and
 
15
 *  limitations under the License.
 
16
 *
 
17
 */
 
18
package org.apache.ivy.osgi.p2;
 
19
 
 
20
import java.io.IOException;
 
21
import java.io.InputStream;
 
22
import java.net.URI;
 
23
import java.net.URISyntaxException;
 
24
import java.text.ParseException;
 
25
import java.util.ArrayList;
 
26
import java.util.Iterator;
 
27
import java.util.List;
 
28
import java.util.Map;
 
29
 
 
30
import javax.xml.parsers.ParserConfigurationException;
 
31
 
 
32
import org.apache.ivy.osgi.core.BundleCapability;
 
33
import org.apache.ivy.osgi.core.BundleInfo;
 
34
import org.apache.ivy.osgi.core.BundleRequirement;
 
35
import org.apache.ivy.osgi.core.ExportPackage;
 
36
import org.apache.ivy.osgi.p2.PropertiesParser.PropertiesHandler;
 
37
import org.apache.ivy.osgi.util.DelegetingHandler;
 
38
import org.apache.ivy.osgi.util.Version;
 
39
import org.apache.ivy.osgi.util.VersionRange;
 
40
import org.apache.ivy.util.Message;
 
41
import org.apache.ivy.util.XMLHelper;
 
42
import org.xml.sax.Attributes;
 
43
import org.xml.sax.SAXException;
 
44
 
 
45
public class P2MetadataParser implements XMLInputParser {
 
46
 
 
47
    private final P2Descriptor p2Descriptor;
 
48
 
 
49
    public P2MetadataParser(P2Descriptor p2Descriptor) {
 
50
        this.p2Descriptor = p2Descriptor;
 
51
    }
 
52
 
 
53
    public void parse(InputStream in) throws ParseException, IOException, SAXException {
 
54
        RepositoryHandler handler = new RepositoryHandler(p2Descriptor);
 
55
        try {
 
56
            XMLHelper.parse(in, null, handler, null);
 
57
        } catch (ParserConfigurationException e) {
 
58
            throw new SAXException(e);
 
59
        }
 
60
    }
 
61
 
 
62
    static class RepositoryHandler extends DelegetingHandler {
 
63
 
 
64
        private static final String REPOSITORY = "repository";
 
65
 
 
66
        // private static final String NAME = "name";
 
67
        //
 
68
        // private static final String TYPE = "type";
 
69
        //
 
70
        // private static final String VERSION = "version";
 
71
        //
 
72
        // private static final String DESCRIPTION = "description";
 
73
        //
 
74
        // private static final String PROVIDER = "provider";
 
75
 
 
76
        public RepositoryHandler(final P2Descriptor p2Descriptor) {
 
77
            super(REPOSITORY);
 
78
            addChild(new PropertiesHandler(), new ChildElementHandler() {
 
79
                public void childHanlded(DelegetingHandler child) {
 
80
                    Map properties = ((PropertiesHandler) child).properties;
 
81
                    String timestamp = (String) properties.get("p2.timestamp");
 
82
                    if (timestamp != null) {
 
83
                        p2Descriptor.setTimestamp(Long.parseLong(timestamp));
 
84
                    }
 
85
                }
 
86
            });
 
87
            addChild(new UnitsHandler(), new ChildElementHandler() {
 
88
                public void childHanlded(DelegetingHandler child) {
 
89
                    Iterator it = ((UnitsHandler) child).bundles.iterator();
 
90
                    while (it.hasNext()) {
 
91
                        p2Descriptor.addBundle((BundleInfo) it.next());
 
92
                    }
 
93
                }
 
94
            });
 
95
            addChild(new ReferencesHandler(), new ChildElementHandler() {
 
96
                public void childHanlded(DelegetingHandler child) {
 
97
                }
 
98
            });
 
99
        }
 
100
 
 
101
        // protected void handleAttributes(Attributes atts) {
 
102
        // String name = atts.getValue(NAME);
 
103
        // String type = atts.getValue(TYPE);
 
104
        // String version = atts.getValue(VERSION);
 
105
        // String description = atts.getValue(DESCRIPTION);
 
106
        // String provider = atts.getValue(PROVIDER);
 
107
        // }
 
108
    }
 
109
 
 
110
    static class ReferencesHandler extends DelegetingHandler {
 
111
 
 
112
        private static final String REFERENCES = "references";
 
113
 
 
114
        private static final String SIZE = "size";
 
115
 
 
116
        List/* <URI> */repositoryUris;
 
117
 
 
118
        public ReferencesHandler() {
 
119
            super(REFERENCES);
 
120
            addChild(new RepositoryReferenceHandler(), new ChildElementHandler() {
 
121
                public void childHanlded(DelegetingHandler child) {
 
122
                    repositoryUris.add(((RepositoryReferenceHandler) child).uri);
 
123
                }
 
124
            });
 
125
        }
 
126
 
 
127
        protected void handleAttributes(Attributes atts) throws SAXException {
 
128
            int size = Integer.parseInt(atts.getValue(SIZE));
 
129
            repositoryUris = new ArrayList(size);
 
130
        }
 
131
    }
 
132
 
 
133
    static class RepositoryReferenceHandler extends DelegetingHandler {
 
134
 
 
135
        private static final String REPOSITORY = "repository";
 
136
 
 
137
        private static final String TYPE = "type";
 
138
 
 
139
        private static final String OPTIONS = "options";
 
140
 
 
141
        private static final String NAME = "name";
 
142
 
 
143
        private static final String URI = "uri";
 
144
 
 
145
        private static final String URL = "url";
 
146
 
 
147
        public RepositoryReferenceHandler() {
 
148
            super(REPOSITORY);
 
149
        }
 
150
 
 
151
        int type;
 
152
 
 
153
        int options;
 
154
 
 
155
        String name;
 
156
 
 
157
        URI uri;
 
158
 
 
159
        protected void handleAttributes(Attributes atts) throws SAXException {
 
160
            type = Integer.parseInt(atts.getValue(TYPE));
 
161
            options = Integer.parseInt(atts.getValue(OPTIONS));
 
162
            name = atts.getValue(NAME);
 
163
 
 
164
            try {
 
165
                String uriAtt = atts.getValue(URI);
 
166
                String url = atts.getValue(URL);
 
167
                if (uri != null) {
 
168
                    uri = new URI(uriAtt);
 
169
                } else if (url != null) {
 
170
                    uri = new URI(url);
 
171
                }
 
172
            } catch (URISyntaxException e) {
 
173
                // TODO Auto-generated catch block
 
174
                e.printStackTrace();
 
175
            }
 
176
        }
 
177
    }
 
178
 
 
179
    static class UnitsHandler extends DelegetingHandler {
 
180
 
 
181
        private static final String UNITS = "units";
 
182
 
 
183
        private static final String SIZE = "size";
 
184
 
 
185
        List bundles;
 
186
 
 
187
        public UnitsHandler() {
 
188
            super(UNITS);
 
189
            addChild(new UnitHandler(), new ChildElementHandler() {
 
190
                public void childHanlded(DelegetingHandler child) {
 
191
                    BundleInfo bundleInfo = ((UnitHandler) child).bundleInfo;
 
192
                    if (!bundleInfo.getCapabilities().isEmpty()) {
 
193
                        bundles.add(((UnitHandler) child).bundleInfo);
 
194
                    }
 
195
                }
 
196
            });
 
197
        }
 
198
 
 
199
        protected void handleAttributes(Attributes atts) {
 
200
            int size = Integer.parseInt(atts.getValue(SIZE));
 
201
            bundles = new ArrayList(size);
 
202
        }
 
203
 
 
204
    }
 
205
 
 
206
    static class UnitHandler extends DelegetingHandler {
 
207
 
 
208
        private static final String UNIT = "unit";
 
209
 
 
210
        private static final String ID = "id";
 
211
 
 
212
        private static final String VERSION = "version";
 
213
 
 
214
        // private static final String SINGLETON = "singleton";
 
215
 
 
216
        BundleInfo bundleInfo;
 
217
 
 
218
        public UnitHandler() {
 
219
            super(UNIT);
 
220
            // addChild(new UpdateHandler(), new ChildElementHandler() {
 
221
            // public void childHanlded(DelegetingHandler child) {
 
222
            // }
 
223
            // });
 
224
            addChild(new PropertiesHandler(), new ChildElementHandler() {
 
225
                public void childHanlded(DelegetingHandler child) {
 
226
                    Map properties = ((PropertiesHandler) child).properties;
 
227
                    String category = (String) properties
 
228
                            .get("org.eclipse.equinox.p2.type.category");
 
229
                    if (category != null && Boolean.valueOf(category).booleanValue()) {
 
230
                        // this is a category definition, this is useless, skip this unit
 
231
                        child.getParent().skip();
 
232
                    }
 
233
                }
 
234
            });
 
235
            addChild(new ProvidesHandler(), new ChildElementHandler() {
 
236
                public void childHanlded(DelegetingHandler child) {
 
237
                    Iterator it = ((ProvidesHandler) child).capabilities.iterator();
 
238
                    while (it.hasNext()) {
 
239
                        bundleInfo.addCapability((BundleCapability) it.next());
 
240
                    }
 
241
                }
 
242
            });
 
243
            addChild(new FilterHandler(), new ChildElementHandler() {
 
244
                public void childHanlded(DelegetingHandler child) {
 
245
                }
 
246
            });
 
247
            addChild(new RequiresHandler(), new ChildElementHandler() {
 
248
                public void childHanlded(DelegetingHandler child) {
 
249
                    Iterator it = ((RequiresHandler) child).requirements.iterator();
 
250
                    while (it.hasNext()) {
 
251
                        bundleInfo.addRequirement((BundleRequirement) it.next());
 
252
                    }
 
253
                }
 
254
            });
 
255
            addChild(new HostRequirementsHandler(), new ChildElementHandler() {
 
256
                public void childHanlded(DelegetingHandler child) {
 
257
                }
 
258
            });
 
259
            addChild(new MetaRequirementsHandler(), new ChildElementHandler() {
 
260
                public void childHanlded(DelegetingHandler child) {
 
261
                }
 
262
            });
 
263
            addChild(new ArtifactsHandler(), new ChildElementHandler() {
 
264
                public void childHanlded(DelegetingHandler child) {
 
265
                }
 
266
            });
 
267
            // addChild(new TouchpointHandler(), new ChildElementHandler() {
 
268
            // public void childHanlded(DelegetingHandler child) {
 
269
            // }
 
270
            // });
 
271
            // addChild(new TouchpointDataHandler(), new ChildElementHandler() {
 
272
            // public void childHanlded(DelegetingHandler child) {
 
273
            // }
 
274
            // });
 
275
            // addChild(new LicensesHandler(), new ChildElementHandler() {
 
276
            // public void childHanlded(DelegetingHandler child) {
 
277
            // }
 
278
            // });
 
279
            // addChild(new CopyrightHandler(), new ChildElementHandler() {
 
280
            // public void childHanlded(DelegetingHandler child) {
 
281
            // }
 
282
            // });
 
283
            addChild(new ChangesHandler(), new ChildElementHandler() {
 
284
                public void childHanlded(DelegetingHandler child) {
 
285
                }
 
286
            });
 
287
 
 
288
        }
 
289
 
 
290
        protected void handleAttributes(Attributes atts) throws SAXException {
 
291
            String id = atts.getValue(ID);
 
292
            String version = atts.getValue(VERSION);
 
293
            // Boolean singleton = Boolean.valueOf(atts.getValue(SINGLETON));
 
294
            try {
 
295
                bundleInfo = new BundleInfo(id, new Version(version));
 
296
            } catch (ParseException e) {
 
297
                throw new SAXException("Incorrect version on bundle '" + id + "': " + version
 
298
                        + " (" + e.getMessage() + ")");
 
299
            }
 
300
        }
 
301
 
 
302
    }
 
303
 
 
304
    // static class UpdateHandler extends DelegetingHandler {
 
305
    //
 
306
    // private static final String UPDATE = "update";
 
307
    //
 
308
    // private static final String ID = "id";
 
309
    //
 
310
    // private static final String RANGE = "range";
 
311
    //
 
312
    // private static final String SEVERITY = "severity";
 
313
    //
 
314
    // public UpdateHandler() {
 
315
    // super(UPDATE);
 
316
    // }
 
317
    //
 
318
    // protected void handleAttributes(Attributes atts) {
 
319
    // String id = atts.getValue(ID);
 
320
    // String range = atts.getValue(RANGE);
 
321
    // String severity = atts.getValue(SEVERITY);
 
322
    // }
 
323
    //
 
324
    // }
 
325
 
 
326
    static class FilterHandler extends DelegetingHandler {
 
327
 
 
328
        private static final String FILTER = "filter";
 
329
 
 
330
        public FilterHandler() {
 
331
            super(FILTER);
 
332
            setBufferingChar(true);
 
333
        }
 
334
 
 
335
    }
 
336
 
 
337
    private static String namespace2Type(String namespace) {
 
338
        if (namespace.equals("java.package")) {
 
339
            return BundleInfo.PACKAGE_TYPE;
 
340
        }
 
341
        if (namespace.equals("osgi.bundle")) {
 
342
            return BundleInfo.BUNDLE_TYPE;
 
343
        }
 
344
        return null;
 
345
    }
 
346
 
 
347
    static class ProvidesHandler extends DelegetingHandler {
 
348
 
 
349
        private static final String PROVIDES = "provides";
 
350
 
 
351
        private static final String SIZE = "size";
 
352
 
 
353
        List capabilities;
 
354
 
 
355
        public ProvidesHandler() {
 
356
            super(PROVIDES);
 
357
            addChild(new ProvidedHandler(), new ChildElementHandler() {
 
358
                public void childHanlded(DelegetingHandler child) {
 
359
                    String name = ((ProvidedHandler) child).name;
 
360
                    Version version = ((ProvidedHandler) child).version;
 
361
                    String type = namespace2Type(((ProvidedHandler) child).namespace);
 
362
                    if (type == null) {
 
363
                        Message.debug("Unsupported provided capability "
 
364
                                + ((ProvidedHandler) child).namespace + " " + name + " " + version);
 
365
                        return;
 
366
                    }
 
367
                    BundleCapability capability;
 
368
                    if (type == BundleInfo.PACKAGE_TYPE) {
 
369
                        capability = new ExportPackage(name, version);
 
370
                    } else {
 
371
                        capability = new BundleCapability(type, name, version);
 
372
                    }
 
373
                    capabilities.add(capability);
 
374
                }
 
375
            });
 
376
        }
 
377
 
 
378
        protected void handleAttributes(Attributes atts) {
 
379
            int size = Integer.parseInt(atts.getValue(SIZE));
 
380
            capabilities = new ArrayList(size);
 
381
        }
 
382
 
 
383
    }
 
384
 
 
385
    static class ProvidedHandler extends DelegetingHandler {
 
386
 
 
387
        private static final String PROVIDED = "provided";
 
388
 
 
389
        private static final String NAMESPACE = "namespace";
 
390
 
 
391
        private static final String NAME = "name";
 
392
 
 
393
        private static final String VERSION = "version";
 
394
 
 
395
        String namespace;
 
396
 
 
397
        String name;
 
398
 
 
399
        Version version;
 
400
 
 
401
        public ProvidedHandler() {
 
402
            super(PROVIDED);
 
403
        }
 
404
 
 
405
        protected void handleAttributes(Attributes atts) throws SAXException {
 
406
            namespace = atts.getValue(NAMESPACE);
 
407
            name = atts.getValue(NAME);
 
408
            try {
 
409
                version = new Version(atts.getValue(VERSION));
 
410
            } catch (ParseException e) {
 
411
                throw new SAXException("Incorrect version on provided capability: " + version
 
412
                        + " (" + e.getMessage() + ")");
 
413
            }
 
414
        }
 
415
 
 
416
    }
 
417
 
 
418
    static abstract class AbstractRequirementHandler extends DelegetingHandler {
 
419
 
 
420
        private static final String SIZE = "size";
 
421
 
 
422
        List requirements;
 
423
 
 
424
        public AbstractRequirementHandler(String name) {
 
425
            super(name);
 
426
            addChild(new RequiredHandler(), new ChildElementHandler() {
 
427
                public void childHanlded(DelegetingHandler child) {
 
428
                    String name = ((RequiredHandler) child).name;
 
429
                    VersionRange range = ((RequiredHandler) child).range;
 
430
                    String type = namespace2Type(((RequiredHandler) child).namespace);
 
431
                    if (type == null) {
 
432
                        Message.debug("Unsupported required capability "
 
433
                                + ((RequiredHandler) child).namespace + " " + name + " " + range);
 
434
                    } else {
 
435
                        requirements.add(new BundleRequirement(type, name, range, null));
 
436
                    }
 
437
                }
 
438
            });
 
439
        }
 
440
 
 
441
        protected void handleAttributes(Attributes atts) {
 
442
            int size = Integer.parseInt(atts.getValue(SIZE));
 
443
            requirements = new ArrayList(size);
 
444
        }
 
445
 
 
446
    }
 
447
 
 
448
    static class RequiresHandler extends AbstractRequirementHandler {
 
449
 
 
450
        private static final String REQUIRES = "requires";
 
451
 
 
452
        public RequiresHandler() {
 
453
            super(REQUIRES);
 
454
        }
 
455
 
 
456
    }
 
457
 
 
458
    static class RequiredHandler extends DelegetingHandler {
 
459
 
 
460
        private static final String REQUIRED = "required";
 
461
 
 
462
        private static final String NAMESPACE = "namespace";
 
463
 
 
464
        private static final String NAME = "name";
 
465
 
 
466
        private static final String RANGE = "range";
 
467
 
 
468
        String namespace;
 
469
 
 
470
        String name;
 
471
 
 
472
        VersionRange range;
 
473
 
 
474
        String filter;
 
475
 
 
476
        public RequiredHandler() {
 
477
            super(REQUIRED);
 
478
            addChild(new FilterHandler(), new ChildElementHandler() {
 
479
                public void childHanlded(DelegetingHandler child) {
 
480
                    filter = child.getBufferedChars().trim();
 
481
                }
 
482
            });
 
483
        }
 
484
 
 
485
        protected void handleAttributes(Attributes atts) {
 
486
            namespace = atts.getValue(NAMESPACE);
 
487
            name = atts.getValue(NAME);
 
488
            try {
 
489
                range = new VersionRange(atts.getValue(RANGE));
 
490
            } catch (ParseException e) {
 
491
                throw new RuntimeException(e);
 
492
            }
 
493
        }
 
494
 
 
495
    }
 
496
 
 
497
    static class HostRequirementsHandler extends AbstractRequirementHandler {
 
498
 
 
499
        private static final String HOST_REQUIREMENTS = "hostRequirements";
 
500
 
 
501
        public HostRequirementsHandler() {
 
502
            super(HOST_REQUIREMENTS);
 
503
        }
 
504
 
 
505
    }
 
506
 
 
507
    static class MetaRequirementsHandler extends AbstractRequirementHandler {
 
508
 
 
509
        private static final String META_REQUIREMENTS = "metaRequirements";
 
510
 
 
511
        public MetaRequirementsHandler() {
 
512
            super(META_REQUIREMENTS);
 
513
        }
 
514
 
 
515
    }
 
516
 
 
517
    static class ArtifactsHandler extends DelegetingHandler {
 
518
 
 
519
        private static final String ARTIFACTS = "artifacts";
 
520
 
 
521
        private static final String SIZE = "size";
 
522
 
 
523
        List artifacts;
 
524
 
 
525
        public ArtifactsHandler() {
 
526
            super(ARTIFACTS);
 
527
            addChild(new ArtifactHandler(), new ChildElementHandler() {
 
528
                public void childHanlded(DelegetingHandler child) {
 
529
                    artifacts.add(((ArtifactHandler) child).artifact);
 
530
                }
 
531
            });
 
532
        }
 
533
 
 
534
        protected void handleAttributes(Attributes atts) {
 
535
            int size = Integer.parseInt(atts.getValue(SIZE));
 
536
            artifacts = new ArrayList(size);
 
537
        }
 
538
 
 
539
    }
 
540
 
 
541
    static class ArtifactHandler extends DelegetingHandler/* <ArtifactsHandler> */{
 
542
 
 
543
        private static final String ARTIFACT = "artifact";
 
544
 
 
545
        private static final String ID = "id";
 
546
 
 
547
        private static final String VERSION = "version";
 
548
 
 
549
        private static final String CLASSIFIER = "classifier";
 
550
 
 
551
        P2Artifact artifact;
 
552
 
 
553
        public ArtifactHandler() {
 
554
            super(ARTIFACT);
 
555
        }
 
556
 
 
557
        protected void handleAttributes(Attributes atts) throws SAXException {
 
558
            String id = atts.getValue(ID);
 
559
            String version = atts.getValue(VERSION);
 
560
            String classifier = atts.getValue(CLASSIFIER);
 
561
            try {
 
562
                artifact = new P2Artifact(id, new Version(version), classifier);
 
563
            } catch (ParseException e) {
 
564
                throw new SAXException("Incorrect version on artifact '" + id + "': " + version
 
565
                        + " (" + e.getMessage() + ")");
 
566
            }
 
567
        }
 
568
 
 
569
    }
 
570
 
 
571
    //
 
572
    // static class TouchpointHandler extends DelegetingHandler {
 
573
    //
 
574
    // private static final String TOUCHPOINT = "touchpoint";
 
575
    //
 
576
    // private static final String ID = "id";
 
577
    //
 
578
    // private static final String VERSION = "version";
 
579
    //
 
580
    // public TouchpointHandler() {
 
581
    // super(TOUCHPOINT);
 
582
    // }
 
583
    //
 
584
    // protected void handleAttributes(Attributes atts) {
 
585
    // String id = atts.getValue(ID);
 
586
    // String version = atts.getValue(VERSION);
 
587
    // }
 
588
    //
 
589
    // }
 
590
    //
 
591
    // static class TouchpointDataHandler extends DelegetingHandler {
 
592
    //
 
593
    // private static final String TOUCHPOINTDATA = "touchpointData";
 
594
    //
 
595
    // private static final String SIZE = "size";
 
596
    //
 
597
    // public TouchpointDataHandler() {
 
598
    // super(TOUCHPOINTDATA);
 
599
    // addChild(new InstructionsHandler(), new ChildElementHandler() {
 
600
    // public void childHanlded(DelegetingHandler child) {
 
601
    // }
 
602
    // });
 
603
    // }
 
604
    //
 
605
    // protected void handleAttributes(Attributes atts) {
 
606
    // String size = atts.getValue(SIZE);
 
607
    // }
 
608
    //
 
609
    // }
 
610
    //
 
611
    // static class InstructionsHandler extends DelegetingHandler {
 
612
    //
 
613
    // private static final String INSTRUCTIONS = "instructions";
 
614
    //
 
615
    // private static final String SIZE = "size";
 
616
    //
 
617
    // public InstructionsHandler() {
 
618
    // super(INSTRUCTIONS);
 
619
    // addChild(new InstructionHandler(), new ChildElementHandler() {
 
620
    // public void childHanlded(DelegetingHandler child) {
 
621
    // }
 
622
    // });
 
623
    // }
 
624
    //
 
625
    // protected void handleAttributes(Attributes atts) {
 
626
    // String size = atts.getValue(SIZE);
 
627
    // }
 
628
    //
 
629
    // }
 
630
    //
 
631
    // static class InstructionHandler extends DelegetingHandler {
 
632
    //
 
633
    // private static final String INSTRUCTION = "instruction";
 
634
    //
 
635
    // private static final String KEY = "key";
 
636
    //
 
637
    // public InstructionHandler() {
 
638
    // super(INSTRUCTION);
 
639
    // setBufferingChar(true);
 
640
    // }
 
641
    //
 
642
    // protected void handleAttributes(Attributes atts) {
 
643
    // String size = atts.getValue(KEY);
 
644
    // }
 
645
    //
 
646
    // }
 
647
    //
 
648
    // static class LicensesHandler extends DelegetingHandler {
 
649
    //
 
650
    // private static final String LICENSES = "licenses";
 
651
    //
 
652
    // private static final String SIZE = "size";
 
653
    //
 
654
    // public LicensesHandler() {
 
655
    // super(LICENSES);
 
656
    // addChild(new LicenseHandler(), new ChildElementHandler() {
 
657
    // public void childHanlded(DelegetingHandler child) {
 
658
    // }
 
659
    // });
 
660
    // }
 
661
    //
 
662
    // protected void handleAttributes(Attributes atts) {
 
663
    // String size = atts.getValue(SIZE);
 
664
    // }
 
665
    //
 
666
    // }
 
667
    //
 
668
    // static class LicenseHandler extends DelegetingHandler {
 
669
    //
 
670
    // private static final String LICENSE = "license";
 
671
    //
 
672
    // private static final String URI = "uri";
 
673
    //
 
674
    // private static final String URL = "url";
 
675
    //
 
676
    // public LicenseHandler() {
 
677
    // super(LICENSE);
 
678
    // setBufferingChar(true);
 
679
    // }
 
680
    //
 
681
    // protected void handleAttributes(Attributes atts) {
 
682
    // String uri = atts.getValue(URI);
 
683
    // String url = atts.getValue(URL);
 
684
    // }
 
685
    //
 
686
    // }
 
687
    //
 
688
    // static class CopyrightHandler extends DelegetingHandler {
 
689
    //
 
690
    // private static final String COPYRIGHT = "copyright";
 
691
    //
 
692
    // private static final String URI = "uri";
 
693
    //
 
694
    // private static final String URL = "url";
 
695
    //
 
696
    // public CopyrightHandler() {
 
697
    // super(COPYRIGHT);
 
698
    // }
 
699
    //
 
700
    // protected void handleAttributes(Attributes atts) {
 
701
    // String uri = atts.getValue(URI);
 
702
    // String url = atts.getValue(URL);
 
703
    // }
 
704
    //
 
705
    // }
 
706
 
 
707
    static class ChangesHandler extends DelegetingHandler {
 
708
 
 
709
        private static final String CHANGES = "changes";
 
710
 
 
711
        // private static final String SIZE = "size";
 
712
 
 
713
        public ChangesHandler() {
 
714
            super(CHANGES);
 
715
            addChild(new ChangeHandler(), new ChildElementHandler() {
 
716
                public void childHanlded(DelegetingHandler child) {
 
717
                }
 
718
            });
 
719
        }
 
720
 
 
721
        protected void handleAttributes(Attributes atts) {
 
722
            // int size = Integer.parseInt(atts.getValue(SIZE));
 
723
        }
 
724
    }
 
725
 
 
726
    static class ChangeHandler extends DelegetingHandler {
 
727
 
 
728
        private static final String CHANGE = "change";
 
729
 
 
730
        public ChangeHandler() {
 
731
            super(CHANGE);
 
732
        }
 
733
    }
 
734
 
 
735
    static class FromHandler extends AbstractRequirementHandler {
 
736
 
 
737
        private static final String FROM = "from";
 
738
 
 
739
        public FromHandler() {
 
740
            super(FROM);
 
741
        }
 
742
 
 
743
    }
 
744
 
 
745
    static class ToHandler extends AbstractRequirementHandler {
 
746
 
 
747
        private static final String TO = "to";
 
748
 
 
749
        public ToHandler() {
 
750
            super(TO);
 
751
        }
 
752
 
 
753
    }
 
754
 
 
755
    static class PatchScopeHandler extends DelegetingHandler {
 
756
 
 
757
        private static final String PATCH_SCOPE = "patchScope";
 
758
 
 
759
        // private static final String SIZE = "size";
 
760
 
 
761
        public PatchScopeHandler() {
 
762
            super(PATCH_SCOPE);
 
763
            addChild(new PatchScopeHandler(), new ChildElementHandler() {
 
764
                public void childHanlded(DelegetingHandler child) {
 
765
                }
 
766
            });
 
767
        }
 
768
 
 
769
        protected void handleAttributes(Attributes atts) {
 
770
            // int size = Integer.parseInt(atts.getValue(SIZE));
 
771
        }
 
772
    }
 
773
 
 
774
    static class ScopeHandler extends DelegetingHandler {
 
775
 
 
776
        private static final String SCOPE = "scope";
 
777
 
 
778
        public ScopeHandler() {
 
779
            super(SCOPE);
 
780
            addChild(new RequiresHandler(), new ChildElementHandler() {
 
781
                public void childHanlded(DelegetingHandler child) {
 
782
                }
 
783
            });
 
784
        }
 
785
    }
 
786
 
 
787
    static class LifeCycleHandler extends AbstractRequirementHandler {
 
788
 
 
789
        private static final String LIFE_CYCLE = "lifeCycle";
 
790
 
 
791
        public LifeCycleHandler() {
 
792
            super(LIFE_CYCLE);
 
793
        }
 
794
    }
 
795
 
 
796
}