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.jstl.core;
20  
21  import org.apache.myfaces.view.facelets.tag.AbstractTagLibrary;
22  
23  /**
24   * @author Jacob Hookom
25   * @version $Id$
26   */
27  public final class JstlCoreLibrary extends AbstractTagLibrary
28  {
29  
30      public final static String NAMESPACE = "http://xmlns.jcp.org/jsp/jstl/core";
31      public final static String ALIAS_NAMESPACE = "http://java.sun.com/jsp/jstl/core";
32  
33      // This namespace was used in the early stages of JSF 2.0 development, but later
34      // it was fixed to use the same syntax for jsp. But some applications still
35      // uses the old syntax and it is too hard to fix them, so in JSF 2.2 it was 
36      // decided to add this namespace as an alternative synonym.
37      public final static String ALTERNATIVE_NAMESPACE = "http://java.sun.com/jstl/core";
38  
39      public final static JstlCoreLibrary INSTANCE = new JstlCoreLibrary();
40  
41      public JstlCoreLibrary()
42      {
43          super(NAMESPACE, ALIAS_NAMESPACE);
44  
45          this.addTagHandler("if", IfHandler.class);
46  
47          this.addTagHandler("forEach", ForEachHandler.class);
48  
49          this.addTagHandler("catch", CatchHandler.class);
50  
51          this.addTagHandler("choose", ChooseHandler.class);
52  
53          this.addTagHandler("when", ChooseWhenHandler.class);
54  
55          this.addTagHandler("otherwise", ChooseOtherwiseHandler.class);
56  
57          this.addTagHandler("set", SetHandler.class);
58      }
59      
60      public JstlCoreLibrary(String namespace)
61      {
62          super(namespace);
63  
64          this.addTagHandler("if", IfHandler.class);
65  
66          this.addTagHandler("forEach", ForEachHandler.class);
67  
68          this.addTagHandler("catch", CatchHandler.class);
69  
70          this.addTagHandler("choose", ChooseHandler.class);
71  
72          this.addTagHandler("when", ChooseWhenHandler.class);
73  
74          this.addTagHandler("otherwise", ChooseOtherwiseHandler.class);
75  
76          this.addTagHandler("set", SetHandler.class);
77      }
78  }