Skip to main content
summaryrefslogtreecommitdiffstats
blob: 541c2ca76219e7c5fc3ecaffe9ea86b2b5e59849 (plain) (blame)
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
/*******************************************************************************
 * Copyright (c) 2001, 2011 Oracle Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *     Oracle Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.jsf.designtime.internal.view.model.jsp;

import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import org.eclipse.jst.jsf.common.dom.TagIdentifier;
import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentTypeInfo;
import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ConverterTypeInfo;
import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.ValidatorTypeInfo;
import org.eclipse.jst.jsf.common.runtime.internal.model.types.TypeInfo;
import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IHandlerTagElement.TagHandlerType;
import org.eclipse.jst.jsf.core.JSFVersion;
import org.eclipse.jst.jsf.core.internal.tld.IJSFConstants;
import org.eclipse.jst.jsf.core.internal.tld.ITLDConstants;

/**
 * Hard-coded TypeInfo for default core and html JSF tags.
 * 
 * @author cbateman
 * 
 */
public final class DefaultTagTypeInfo
{
    private final static Set<String> URI_IS_A_JSF_LIB;

    static
    {
        final Set<String> libs = new HashSet<String>();
        libs.add(ITLDConstants.URI_JSF_CORE);
        libs.add(ITLDConstants.URI_JSF_HTML);
        URI_IS_A_JSF_LIB = Collections.unmodifiableSet(libs);
    }

    /**
     * @param tagId
     * @param jsfVersion
     * @return a type info for the tag id in jsf version or null if none.
     */
    public TypeInfo getTypeInfo(final TagIdentifier tagId,
            final JSFVersion jsfVersion)
    {

        switch (jsfVersion)
        {
            case V1_0:
            case V1_1:
                return JSF11_ELEMENTS.get(tagId);

            case V1_2:
                return JSF12_ELEMENTS.get(tagId);

            case V2_0:
            	return JSF20_ELEMENTS.get(tagId);

            default:
                return null;
        }
    }

    /**
     * @param uri
     * @return true if uri is covered by this class
     */
    public static boolean isDefaultLib(final String uri)
    {
        return URI_IS_A_JSF_LIB.contains(uri);
    }

    private static final ComponentTypeInfo      COMPINFO_PARAM                 = new ComponentTypeInfo(
                                                                                       "javax.faces.Parameter", //$NON-NLS-1$
                                                                                       "javax.faces.component.UIParameter", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.Parameter", //$NON-NLS-1$
                                                                                       null);

    private static final ComponentTypeInfo      COMPINFO_SELECTITEM            = new ComponentTypeInfo(
                                                                                       "javax.faces.SelectItem", //$NON-NLS-1$
                                                                                       "javax.faces.component.UISelectItem", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectItem", //$NON-NLS-1$
                                                                                       null);

    private static final ComponentTypeInfo      COMPINFO_SELECTITEMS           = new ComponentTypeInfo(
                                                                                       "javax.faces.SelectItems", //$NON-NLS-1$
                                                                                       "javax.faces.component.UISelectItems", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectItems", //$NON-NLS-1$
                                                                                       null);

    private static final ComponentTypeInfo      COMPINFO_SUBVIEW               = new ComponentTypeInfo(
                                                                                       "javax.faces.NamingContainer", //$NON-NLS-1$
                                                                                       "javax.faces.component.UINamingContainer", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.NamingContainer", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.NamingContainer", //$NON-NLS-1$
                                                                                       null);

    private static final ComponentTypeInfo      COMPINFO_VERBATIM              = new ComponentTypeInfo(
                                                                                       "javax.faces.Output", //$NON-NLS-1$
                                                                                       "javax.faces.component.UIOutput", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.Output", //$NON-NLS-1$
                                                                                       "javax.faces.Text"); //$NON-NLS-1$

    private static final ComponentTypeInfo      COMPINFO_VIEW                  = new ComponentTypeInfo(
                                                                                       "javax.faces.ViewRoot", //$NON-NLS-1$
                                                                                       "javax.faces.component.UIViewRoot", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.ViewRoot", //$NON-NLS-1$
                                                                                       null);

    private static final ComponentTypeInfo      COMPINFO_VIEWPARAM            = new ComponentTypeInfo(
    		                                                                          "javax.faces.ViewParameter", //$NON-NLS-1$
    		                                                                          "javax.faces.component.UIViewParameter", //$NON-NLS-1$
                                                                                      new String[]
                                                                                      {
           "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
           "javax.faces.component.UIComponentBase", //$NON-NLS-1$
           "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                      new String[]
                                                                                      {
           "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
           "javax.faces.component.ValueHolder", //$NON-NLS-1$
           "javax.faces.component.StateHolder"                                       }, //$NON-NLS-1$
    		                                                                          "javax.faces.ViewParameter", //$NON-NLS-1$
    		                                                                          null);

    // expected type info for jsf/html components
    private static final ComponentTypeInfo      COMPINFO_COLUMN                = new ComponentTypeInfo(
                                                                                       "javax.faces.Column", //$NON-NLS-1$
                                                                                       "javax.faces.component.UIColumn", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object"                   }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder" }, //$NON-NLS-1$
                                                                                       "javax.faces.Column", //$NON-NLS-1$
                                                                                       null);
    private static final ComponentTypeInfo      COMPINFO_COMMAND               = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlCommandButton", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlCommandButton", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UICommand", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object"                   }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.ActionSource", //$NON-NLS-1$
            "javax.faces.component.StateHolder"                                       }, //$NON-NLS-1$
                                                                                       "javax.faces.Command", //$NON-NLS-1$
                                                                                       "javax.faces.Button"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_COMMANDLINK           = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlCommandLink", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlCommandLink", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UICommand", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object"                   }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.ActionSource", //$NON-NLS-1$
            "javax.faces.component.StateHolder"                                       }, //$NON-NLS-1$
                                                                                       "javax.faces.Command", //$NON-NLS-1$
                                                                                       "javax.faces.Link"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_DATATABLE             = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlDataTable", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlDataTable", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIData", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object"                   }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.NamingContainer", //$NON-NLS-1$
            "javax.faces.component.StateHolder"                                       }, //$NON-NLS-1$
                                                                                       "javax.faces.Data", //$NON-NLS-1$
                                                                                       "javax.faces.Table"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_FORM                  = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlForm", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlForm", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIForm", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object"                   }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.NamingContainer", //$NON-NLS-1$
            "javax.faces.component.StateHolder"                                       }, //$NON-NLS-1$
                                                                                       "javax.faces.Form", //$NON-NLS-1$
                                                                                       "javax.faces.Form"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_GRAPHIC               = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlGraphicImage", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlGraphicImage", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIGraphic", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.Graphic", //$NON-NLS-1$
                                                                                       "javax.faces.Image"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_HIDDEN                = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlInputHidden", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlInputHidden", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.Input", //$NON-NLS-1$
                                                                                       "javax.faces.Hidden"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_SECRET                = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlInputSecret", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlInputSecret", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder"                                       }, //$NON-NLS-1$
                                                                                       "javax.faces.Input", //$NON-NLS-1$
                                                                                       "javax.faces.Secret"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_INPUTTEXT             = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlInputText", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlInputText", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object"                   }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder"                                       }, //$NON-NLS-1$
                                                                                       "javax.faces.Input", //$NON-NLS-1$
                                                                                       "javax.faces.Text"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_INPUTTEXTAREA         = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlInputTextarea", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlInputTextarea", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.Input", //$NON-NLS-1$
                                                                                       "javax.faces.Textarea"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_MESSAGE               = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlMessage", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlMessage", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIMessage", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.Message", //$NON-NLS-1$
                                                                                       "javax.faces.Message"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_MESSAGES              = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlMessages", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlMessages", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIMessages", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.Messages", //$NON-NLS-1$
                                                                                       "javax.faces.Messages"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_OUTPUTFORMAT          = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlOutputFormat", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlOutputFormat", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIOutput", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.Output", //$NON-NLS-1$
                                                                                       "javax.faces.Format"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_OUTPUTLABEL           = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlOutputLabel", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlOutputLabel", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIOutput", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.Output", //$NON-NLS-1$
                                                                                       "javax.faces.Label"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_OUTPUTLINK            = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlOutputLink", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlOutputLink", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIOutput", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.Output", //$NON-NLS-1$
                                                                                       "javax.faces.Link"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_OUTPUTTEXT            = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlOutputText", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlOutputText", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIOutput", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.Output", //$NON-NLS-1$
                                                                                       "javax.faces.Text"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_PANELGRID             = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlPanelGrid", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlPanelGrid", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIPanel", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.Panel", //$NON-NLS-1$
                                                                                       "javax.faces.Grid"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_PANELGROUP            = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlPanelGroup", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlPanelGroup", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UIPanel", //$NON-NLS-1$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       { "javax.faces.component.StateHolder", }, //$NON-NLS-1$
                                                                                       "javax.faces.Panel", //$NON-NLS-1$
                                                                                       "javax.faces.Group"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_SELECTBOOLEANCHECKBOX = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlSelectBooleanCheckbox", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlSelectBooleanCheckbox", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UISelectBoolean", //$NON-NLS-1$
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectBoolean", //$NON-NLS-1$
                                                                                       "javax.faces.Checkbox"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_SELECTMANYCHECKBOX    = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlSelectManyCheckbox", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlSelectManyCheckbox", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UISelectMany", //$NON-NLS-1$
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectMany", //$NON-NLS-1$
                                                                                       "javax.faces.Checkbox"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_SELECTMANYLISTBOX     = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlSelectManyListbox", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlSelectManyListbox", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UISelectMany", //$NON-NLS-1$
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectMany", //$NON-NLS-1$
                                                                                       "javax.faces.Listbox"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_SELECTMANYMENU        = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlSelectManyMenu", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlSelectManyMenu", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UISelectMany", //$NON-NLS-1$
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectMany", //$NON-NLS-1$
                                                                                       "javax.faces.Menu"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_SELECTONELISTBOX      = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlSelectOneListbox", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlSelectOneListbox", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UISelectOne", //$NON-NLS-1$
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectOne", //$NON-NLS-1$
                                                                                       "javax.faces.Listbox"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_SELECTONEMENU         = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlSelectOneMenu", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlSelectOneMenu", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UISelectOne", //$NON-NLS-1$
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectOne", //$NON-NLS-1$
                                                                                       "javax.faces.Menu"); //$NON-NLS-1$
    private static final ComponentTypeInfo      COMPINFO_SELECTONERADIO        = new ComponentTypeInfo(
                                                                                       "javax.faces.HtmlSelectOneRadio", //$NON-NLS-1$
                                                                                       "javax.faces.component.html.HtmlSelectOneRadio", //$NON-NLS-1$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.UISelectOne", //$NON-NLS-1$
            "javax.faces.component.UIInput", "javax.faces.component.UIOutput", //$NON-NLS-1$ //$NON-NLS-2$
            "javax.faces.component.UIComponentBase", //$NON-NLS-1$
            "javax.faces.component.UIComponent", "java.lang.Object",                  }, //$NON-NLS-1$ //$NON-NLS-2$
                                                                                       new String[]
                                                                                       {
            "javax.faces.component.EditableValueHolder", //$NON-NLS-1$
            "javax.faces.component.ValueHolder", //$NON-NLS-1$
            "javax.faces.component.StateHolder",                                      }, //$NON-NLS-1$
                                                                                       "javax.faces.SelectOne", //$NON-NLS-1$
                                                                                       "javax.faces.Radio"); //$NON-NLS-1$

    // default converters
    private static final ConverterTypeInfo      CONVERTERINFO_DATETIME         = new ConverterTypeInfo(
                                                                                       "javax.faces.convert.DateTimeConverter", //$NON-NLS-1$
                                                                                       "javax.faces.DateTime"); //$NON-NLS-1$

    private static final ConverterTypeInfo      CONVERTERINFO_NUMBER           = new ConverterTypeInfo(
                                                                                       "javax.faces.convert.NumberConverter", //$NON-NLS-1$
                                                                                       "javax.faces.Number"); //$NON-NLS-1$

    // default validators
    private static final ValidatorTypeInfo      VALIDATORINFO_BEAN             = new ValidatorTypeInfo(
    		                                                                           "javax.faces.validator.BeanValidator", //$NON-NLS-1$
    		                                                                           "javax.faces.Bean"); //$NON-NLS-1$

    private static final ValidatorTypeInfo      VALIDATORINFO_DOUBLERANGE      = new ValidatorTypeInfo(
                                                                                       "javax.faces.validator.DoubleRangeValidator", //$NON-NLS-1$
                                                                                       "javax.faces.DoubleRange"); //$NON-NLS-1$

    private static final ValidatorTypeInfo      VALIDATORINFO_LENGTH           = new ValidatorTypeInfo(
                                                                                       "javax.faces.validator.LengthValidator", //$NON-NLS-1$
                                                                                       "javax.faces.Length"); //$NON-NLS-1$

    private static final ValidatorTypeInfo      VALIDATORINFO_LONGRANGE        = new ValidatorTypeInfo(
                                                                                       "javax.faces.validator.LongRangeValidator", //$NON-NLS-1$
                                                                                       "javax.faces.LongRange"); //$NON-NLS-1$

    private static final ValidatorTypeInfo      VALIDATORINFO_REGEX            = new ValidatorTypeInfo(
    		                                                                           "javax.faces.validator.RegexValidator", //$NON-NLS-1$
                                                                                       "javax.faces.RegularExpression"); //$NON-NLS-1$

    private static final ValidatorTypeInfo      VALIDATORINFO_REQUIRED         = new ValidatorTypeInfo(
                                                                                       "javax.faces.validator.RequiredValidator", //$NON-NLS-1$
                                                                                       "javax.faces.Required"); //$NON-NLS-1$

    private static Map<TagIdentifier, TypeInfo> JSF11_ELEMENTS;
    private static Map<TagIdentifier, TypeInfo> JSF12_ELEMENTS;
    private static Map<TagIdentifier, TypeInfo> JSF20_ELEMENTS;

    static
    {
        final Map<TagIdentifier, TypeInfo> commonElements = new HashMap<TagIdentifier, TypeInfo>();
        // IJSFConstants.TAG_IDENTIFIER_PHASELISTENER);
        // IJSFConstants.TAG_IDENTIFIER_SETPROPERTYACTIONLISTENER);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_ACTIONLISTENER,
                TagHandlerType.ACTIONLISTENER);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_ATTRIBUTE,
                TagHandlerType.ATTRIBUTE);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_CONVERTDATETIME,
                CONVERTERINFO_DATETIME);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_CONVERTER,
                ConverterTypeInfo.UNKNOWN);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_CONVERTNUMBER,
                CONVERTERINFO_NUMBER);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_FACET, TagHandlerType.FACET);
        // elements.put(IJSFConstants.TAG_IDENTIFIER_LOADBUNDLE,
        // TagHandlerType.);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_PARAM, COMPINFO_PARAM);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTITEM,
                COMPINFO_SELECTITEM);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTITEMS,
                COMPINFO_SELECTITEMS);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SUBVIEW, COMPINFO_SUBVIEW);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATEDOUBLERANGE,
                VALIDATORINFO_DOUBLERANGE);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATELENGTH,
                VALIDATORINFO_LENGTH);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATELONGRANGE,
                VALIDATORINFO_LONGRANGE);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATOR,
                ValidatorTypeInfo.UNKNOWN);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_VALUECHANGELISTENER,
                TagHandlerType.VALUECHANGELISTENER);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_VERBATIM, COMPINFO_VERBATIM);
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_VIEW, COMPINFO_VIEW);

        // JSF 1.2 core elements
        // none currently...

        // JSF 1.1/1.2 HTML tags
        // html verifier
        commonElements.put(IJSFConstants.TAG_IDENTIFIER_COLUMN, COMPINFO_COLUMN);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_COMMANDBUTTON,
                COMPINFO_COMMAND);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_COMMANDLINK,
                COMPINFO_COMMANDLINK);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_DATA_TABLE,
                COMPINFO_DATATABLE);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_FORM, COMPINFO_FORM);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_GRAPHICIMAGE,
                COMPINFO_GRAPHIC);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_INPUTHIDDEN, COMPINFO_HIDDEN);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_INPUTSECRET, COMPINFO_SECRET);

        commonElements
                .put(IJSFConstants.TAG_IDENTIFIER_INPUTTEXT, COMPINFO_INPUTTEXT);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_INPUTTEXTAREA,
                COMPINFO_INPUTTEXTAREA);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_MESSAGE, COMPINFO_MESSAGE);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_MESSAGES, COMPINFO_MESSAGES);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_OUTPUTFORMAT,
                COMPINFO_OUTPUTFORMAT);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_OUTPUTLABEL,
                COMPINFO_OUTPUTLABEL);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_OUTPUTLINK,
                COMPINFO_OUTPUTLINK);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_OUTPUTTEXT,
                COMPINFO_OUTPUTTEXT);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_PANEL_GRID,
                COMPINFO_PANELGRID);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_PANEL_GROUP,
                COMPINFO_PANELGROUP);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTBOOLEANCHECKBOX,
                COMPINFO_SELECTBOOLEANCHECKBOX);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTMANYCHECKBOX,
                COMPINFO_SELECTMANYCHECKBOX);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTMANYLISTBOX,
                COMPINFO_SELECTMANYLISTBOX);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTMANYMENU,
                COMPINFO_SELECTMANYMENU);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTONELISTBOX,
                COMPINFO_SELECTONELISTBOX);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTONEMENU,
                COMPINFO_SELECTONEMENU);

        commonElements.put(IJSFConstants.TAG_IDENTIFIER_SELECTONERADIO,
                COMPINFO_SELECTONERADIO);

        JSF11_ELEMENTS = Collections.unmodifiableMap(commonElements);

        JSF12_ELEMENTS = Collections
                .unmodifiableMap(new HashMap<TagIdentifier, TypeInfo>(commonElements));

        //JSF 2.0
        Map<TagIdentifier, TypeInfo> jsf20Elements = new HashMap<TagIdentifier, TypeInfo>(commonElements);
        jsf20Elements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATEBEAN, VALIDATORINFO_BEAN);
        jsf20Elements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATEREGEX, VALIDATORINFO_REGEX);
        jsf20Elements.put(IJSFConstants.TAG_IDENTIFIER_VALIDATEREQUIRED, VALIDATORINFO_REQUIRED);
        jsf20Elements.put(IJSFConstants.TAG_IDENTIFIER_VIEWPARAM, COMPINFO_VIEWPARAM);
        JSF20_ELEMENTS = Collections.unmodifiableMap(jsf20Elements);
    }

}

Back to the top