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;
20  
21  import java.lang.reflect.Method;
22  
23  import javax.faces.FacesException;
24  import javax.faces.view.facelets.TagConfig;
25  import javax.faces.view.facelets.TagHandler;
26  
27  /**
28   * A library of Tags associated with one or more namespaces.
29   * 
30   * @author Jacob Hookom
31   * @version $Id$
32   */
33  public interface TagLibrary
34  {
35  
36      /**
37       * If this library contains the passed namespace
38       * 
39       * @param ns
40       *            namespace
41       * @return true if the namespace is used in this library
42       */
43      public boolean containsNamespace(String ns);
44  
45      /**
46       * If this library contains a TagHandler for the namespace and local name
47       * 
48       * @param ns
49       *            namespace
50       * @param localName
51       *            local name
52       * @return true if handled by this library
53       */
54      public boolean containsTagHandler(String ns, String localName);
55  
56      /**
57       * Create a new instance of a TagHandler, using the passed TagConfig
58       * 
59       * @param ns
60       *            namespace
61       * @param localName
62       *            local name
63       * @param tag
64       *            configuration information
65       * @return a new TagHandler instance
66       * @throws FacesException
67       */
68      public TagHandler createTagHandler(String ns, String localName, TagConfig tag) throws FacesException;
69  
70      /**
71       * If this library contains the specified function name
72       * 
73       * @param ns
74       *            namespace
75       * @param name
76       *            function name
77       * @return true if handled
78       */
79      public boolean containsFunction(String ns, String name);
80  
81      /**
82       * Return a Method instance for the passed namespace and name
83       * 
84       * @param ns
85       *            namespace
86       * @param name
87       *            function name
88       * @return
89       */
90      public Method createFunction(String ns, String name);
91  }