View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.view.facelets.tag.jsf.core;
20  
21  import javax.faces.component.UIParameter;
22  import javax.faces.component.UISelectItem;
23  import javax.faces.component.UISelectItems;
24  import javax.faces.component.UIViewParameter;
25  import javax.faces.convert.DateTimeConverter;
26  import javax.faces.convert.NumberConverter;
27  import javax.faces.validator.BeanValidator;
28  import javax.faces.validator.DoubleRangeValidator;
29  import javax.faces.validator.LengthValidator;
30  import javax.faces.validator.LongRangeValidator;
31  import javax.faces.validator.RegexValidator;
32  import javax.faces.validator.RequiredValidator;
33  
34  import org.apache.myfaces.view.facelets.tag.AbstractTagLibrary;
35  
36  /**
37   * For Tag details, see JSF Core <a target="_new"
38   * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/tld-summary.html">taglib documentation</a>.
39   *
40   * @author Jacob Hookom
41   * @version $Id: CoreLibrary.java 1187700 2011-10-22 12:19:37Z bommel $
42   */
43  public final class CoreLibrary extends AbstractTagLibrary
44  {
45  
46      public final static String Namespace = "http://java.sun.com/jsf/core";
47  
48      public final static CoreLibrary Instance = new CoreLibrary();
49  
50      public CoreLibrary()
51      {
52          super(Namespace);
53  
54          this.addTagHandler("actionListener", ActionListenerHandler.class);
55  
56          this.addTagHandler("ajax", AjaxHandler.class);
57          
58          this.addTagHandler("attribute", AttributeHandler.class);
59  
60          this.addConverter("convertDateTime", DateTimeConverter.CONVERTER_ID, ConvertDateTimeHandler.class);
61  
62          this.addConverter("convertNumber", NumberConverter.CONVERTER_ID, ConvertNumberHandler.class);
63  
64          this.addConverter("converter", null, ConvertDelegateHandler.class);
65          
66          this.addTagHandler ("event", EventHandler.class);
67          
68          this.addTagHandler("facet", FacetHandler.class);
69  
70          this.addTagHandler("loadBundle", LoadBundleHandler.class);
71  
72          this.addTagHandler("metadata", ViewMetadataHandler.class);
73          
74          this.addComponent("param", UIParameter.COMPONENT_TYPE, null);
75  
76          this.addTagHandler("phaseListener", PhaseListenerHandler.class);
77  
78          this.addComponent("selectItem", UISelectItem.COMPONENT_TYPE, null, SelectItemHandler.class);
79  
80          this.addComponent("selectItems", UISelectItems.COMPONENT_TYPE, null, SelectItemsHandler.class);
81  
82          this.addTagHandler("setPropertyActionListener", SetPropertyActionListenerHandler.class);
83  
84          this.addComponent("subview", "javax.faces.NamingContainer", null);
85  
86          this.addValidator("validateBean", BeanValidator.VALIDATOR_ID);
87          
88          this.addValidator("validateLength", LengthValidator.VALIDATOR_ID);
89  
90          this.addValidator("validateLongRange", LongRangeValidator.VALIDATOR_ID);
91  
92          this.addValidator("validateDoubleRange", DoubleRangeValidator.VALIDATOR_ID);
93  
94          this.addValidator("validateRegex", RegexValidator.VALIDATOR_ID);
95          
96          this.addValidator("validateRequired", RequiredValidator.VALIDATOR_ID);
97  
98          this.addValidator("validator", null, ValidateDelegateHandler.class);
99  
100         this.addTagHandler("valueChangeListener", ValueChangeListenerHandler.class);
101 
102         this.addTagHandler("view", ViewHandler.class);
103         
104         this.addComponent("viewParam", UIViewParameter.COMPONENT_TYPE, null);
105 
106         this.addComponent("verbatim", "javax.faces.HtmlOutputText", "javax.faces.Text", VerbatimHandler.class);
107     }
108 }