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.UIViewAction;
25  import javax.faces.component.UIViewParameter;
26  import javax.faces.convert.DateTimeConverter;
27  import javax.faces.convert.NumberConverter;
28  import javax.faces.validator.BeanValidator;
29  import javax.faces.validator.DoubleRangeValidator;
30  import javax.faces.validator.LengthValidator;
31  import javax.faces.validator.LongRangeValidator;
32  import javax.faces.validator.RegexValidator;
33  import javax.faces.validator.RequiredValidator;
34  
35  import org.apache.myfaces.view.facelets.tag.AbstractTagLibrary;
36  
37  /**
38   * For Tag details, see JSF Core <a target="_new"
39   * href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f/tld-summary.html">taglib documentation</a>.
40   *
41   * @author Jacob Hookom
42   * @version $Id$
43   */
44  public final class CoreLibrary extends AbstractTagLibrary
45  {
46  
47      public final static String NAMESPACE = "http://xmlns.jcp.org/jsf/core";
48      public final static String ALIAS_NAMESPACE = "http://java.sun.com/jsf/core";
49  
50      public final static CoreLibrary INSTANCE = new CoreLibrary();
51  
52      public CoreLibrary()
53      {
54          super(NAMESPACE, ALIAS_NAMESPACE);
55  
56          this.addTagHandler("actionListener", ActionListenerHandler.class);
57  
58          this.addTagHandler("ajax", AjaxHandler.class);
59          
60          this.addTagHandler("attribute", AttributeHandler.class);
61          
62          this.addTagHandler("attributes", AttributesHandler.class);
63  
64          this.addConverter("convertDateTime", DateTimeConverter.CONVERTER_ID, ConvertDateTimeHandler.class);
65  
66          this.addConverter("convertNumber", NumberConverter.CONVERTER_ID, ConvertNumberHandler.class);
67  
68          this.addConverter("converter", null, ConvertDelegateHandler.class);
69          
70          this.addTagHandler ("event", EventHandler.class);
71          
72          this.addTagHandler("facet", FacetHandler.class);
73  
74          this.addTagHandler("loadBundle", LoadBundleHandler.class);
75  
76          this.addTagHandler("metadata", ViewMetadataHandler.class);
77          
78          this.addComponent("param", UIParameter.COMPONENT_TYPE, null);
79          
80          this.addTagHandler("passThroughAttribute", PassThroughAttributeHandler.class);
81          
82          this.addTagHandler("passThroughAttributes", PassThroughAttributesHandler.class);
83  
84          this.addTagHandler("phaseListener", PhaseListenerHandler.class);
85          
86          this.addTagHandler("resetValues", ResetValuesActionListenerHandler.class);
87  
88          this.addComponent("selectItem", UISelectItem.COMPONENT_TYPE, null, SelectItemHandler.class);
89  
90          this.addComponent("selectItems", UISelectItems.COMPONENT_TYPE, null, SelectItemsHandler.class);
91  
92          this.addTagHandler("setPropertyActionListener", SetPropertyActionListenerHandler.class);
93  
94          this.addComponent("subview", "javax.faces.NamingContainer", null);
95  
96          this.addValidator("validateBean", BeanValidator.VALIDATOR_ID);
97          
98          this.addValidator("validateLength", LengthValidator.VALIDATOR_ID);
99  
100         this.addValidator("validateLongRange", LongRangeValidator.VALIDATOR_ID);
101 
102         this.addValidator("validateDoubleRange", DoubleRangeValidator.VALIDATOR_ID);
103 
104         this.addValidator("validateRegex", RegexValidator.VALIDATOR_ID);
105         
106         this.addValidator("validateRequired", RequiredValidator.VALIDATOR_ID);
107 
108         this.addValidator("validator", null, ValidateDelegateHandler.class);
109 
110         this.addTagHandler("valueChangeListener", ValueChangeListenerHandler.class);
111 
112         this.addTagHandler("view", ViewHandler.class);
113         
114         this.addComponent("viewAction", UIViewAction.COMPONENT_TYPE, null);
115         
116         this.addComponent("viewParam", UIViewParameter.COMPONENT_TYPE, null);
117 
118         this.addComponent("verbatim", "javax.faces.HtmlOutputText", "javax.faces.Text", VerbatimHandler.class);
119     }
120 }