org.apache.myfaces.view.facelets.tag
Class AbstractTagLibrary

java.lang.Object
  extended by org.apache.myfaces.view.facelets.tag.AbstractTagLibrary
All Implemented Interfaces:
TagLibrary
Direct Known Subclasses:
AbstractHtmlLibrary, CompositeLibrary, CoreLibrary, JstlCoreLibrary, UILibrary

public abstract class AbstractTagLibrary
extends Object
implements TagLibrary

Base class for defining TagLibraries in Java

Version:
$Id: AbstractTagLibrary.java 1187700 2011-10-22 12:19:37Z bommel $
Author:
Jacob Hookom

Constructor Summary
AbstractTagLibrary(String namespace)
           
 
Method Summary
protected  void addBehavior(String name, String behaviorId)
           
protected  void addBehavior(String name, String behaviorId, Class<? extends TagHandler> handlerType)
           
protected  void addComponent(String name, String componentType, String rendererType)
          Add a ComponentHandler with the specified componentType and rendererType, aliased by the tag name.
protected  void addComponent(String name, String componentType, String rendererType, Class<? extends TagHandler> handlerType)
          Add a ComponentHandler with the specified componentType and rendererType, aliased by the tag name.
protected  void addConverter(String name, String converterId)
          Add a ConvertHandler for the specified converterId
protected  void addConverter(String name, String converterId, Class<? extends TagHandler> type)
          Add a ConvertHandler for the specified converterId of a TagHandler type
protected  void addFunction(String name, Method method)
          Add a Method to be used as a Function at Compilation.
protected  void addTagHandler(String name, Class<? extends TagHandler> handlerType)
          Use the specified HandlerType in compiling Facelets.
protected  void addUserTag(String name, URL source)
          Add a UserTagHandler specified a the URL source.
protected  void addValidator(String name, String validatorId)
          Add a ValidateHandler for the specified validatorId
protected  void addValidator(String name, String validatorId, Class<? extends TagHandler> type)
          Add a ValidateHandler for the specified validatorId
 boolean containsFunction(String ns, String name)
          If this library contains the specified function name
 boolean containsNamespace(String ns)
          If this library contains the passed namespace
 boolean containsTagHandler(String ns, String localName)
          If this library contains a TagHandler for the namespace and local name
 Method createFunction(String ns, String name)
          Return a Method instance for the passed namespace and name
 TagHandler createTagHandler(String ns, String localName, TagConfig tag)
          Create a new instance of a TagHandler, using the passed TagConfig
 String getNamespace()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTagLibrary

public AbstractTagLibrary(String namespace)
Method Detail

containsNamespace

public boolean containsNamespace(String ns)
Description copied from interface: TagLibrary
If this library contains the passed namespace

Specified by:
containsNamespace in interface TagLibrary
Parameters:
ns - namespace
Returns:
true if the namespace is used in this library

containsTagHandler

public boolean containsTagHandler(String ns,
                                  String localName)
Description copied from interface: TagLibrary
If this library contains a TagHandler for the namespace and local name

Specified by:
containsTagHandler in interface TagLibrary
Parameters:
ns - namespace
localName - local name
Returns:
true if handled by this library

createTagHandler

public TagHandler createTagHandler(String ns,
                                   String localName,
                                   TagConfig tag)
                            throws FacesException
Description copied from interface: TagLibrary
Create a new instance of a TagHandler, using the passed TagConfig

Specified by:
createTagHandler in interface TagLibrary
Parameters:
ns - namespace
localName - local name
tag - configuration information
Returns:
a new TagHandler instance
Throws:
FacesException

containsFunction

public boolean containsFunction(String ns,
                                String name)
Description copied from interface: TagLibrary
If this library contains the specified function name

Specified by:
containsFunction in interface TagLibrary
Parameters:
ns - namespace
name - function name
Returns:
true if handled

createFunction

public Method createFunction(String ns,
                             String name)
Description copied from interface: TagLibrary
Return a Method instance for the passed namespace and name

Specified by:
createFunction in interface TagLibrary
Parameters:
ns - namespace
name - function name
Returns:

getNamespace

public String getNamespace()

addComponent

protected final void addComponent(String name,
                                  String componentType,
                                  String rendererType)
Add a ComponentHandler with the specified componentType and rendererType, aliased by the tag name.

Parameters:
name - name to use, "foo" would be <my:foo />
componentType - componentType to use
rendererType - rendererType to use
See Also:
ComponentHandler, Application.createComponent(java.lang.String)

addComponent

protected final void addComponent(String name,
                                  String componentType,
                                  String rendererType,
                                  Class<? extends TagHandler> handlerType)
Add a ComponentHandler with the specified componentType and rendererType, aliased by the tag name. The Facelet will be compiled with the specified HandlerType (which must extend AbstractComponentHandler).

Parameters:
name - name to use, "foo" would be <my:foo />
componentType - componentType to use
rendererType - rendererType to use
handlerType - a Class that extends AbstractComponentHandler
See Also:
AbstractComponentHandler

addConverter

protected final void addConverter(String name,
                                  String converterId)
Add a ConvertHandler for the specified converterId

Parameters:
name - name to use, "foo" would be <my:foo />
converterId - id to pass to Application instance
See Also:
ConverterHandler, Application.createConverter(java.lang.String)

addConverter

protected final void addConverter(String name,
                                  String converterId,
                                  Class<? extends TagHandler> type)
Add a ConvertHandler for the specified converterId of a TagHandler type

Parameters:
name - name to use, "foo" would be <my:foo />
converterId - id to pass to Application instance
type - TagHandler type that takes in a ConverterConfig
See Also:
ConverterHandler, ConverterConfig, Application.createConverter(java.lang.String)

addValidator

protected final void addValidator(String name,
                                  String validatorId)
Add a ValidateHandler for the specified validatorId

Parameters:
name - name to use, "foo" would be <my:foo />
validatorId - id to pass to Application instance
See Also:
ValidatorHandler, Application.createValidator(java.lang.String)

addValidator

protected final void addValidator(String name,
                                  String validatorId,
                                  Class<? extends TagHandler> type)
Add a ValidateHandler for the specified validatorId

Parameters:
name - name to use, "foo" would be <my:foo />
validatorId - id to pass to Application instance
type - TagHandler type that takes in a ValidatorConfig
See Also:
ValidatorHandler, ValidatorConfig, Application.createValidator(java.lang.String)

addTagHandler

protected final void addTagHandler(String name,
                                   Class<? extends TagHandler> handlerType)
Use the specified HandlerType in compiling Facelets. HandlerType must extend TagHandler.

Parameters:
name - name to use, "foo" would be <my:foo />
handlerType - must extend TagHandler
See Also:
TagHandler

addUserTag

protected final void addUserTag(String name,
                                URL source)
Add a UserTagHandler specified a the URL source.

Parameters:
name - name to use, "foo" would be <my:foo />
source - source where the Facelet (Tag) source is
See Also:
UserTagHandler

addFunction

protected final void addFunction(String name,
                                 Method method)
Add a Method to be used as a Function at Compilation.

Parameters:
name - (suffix) of function name
method - method instance
See Also:
FunctionMapper

addBehavior

protected final void addBehavior(String name,
                                 String behaviorId)
Parameters:
behaviorId -
behaviorClass -
Since:
2.0

addBehavior

protected final void addBehavior(String name,
                                 String behaviorId,
                                 Class<? extends TagHandler> handlerType)
Parameters:
behaviorId -
behaviorClass -
handlerType -
Since:
2.0


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.