org.codehaus.groovy.grails.web.pages
Class TagLibraryLookup

java.lang.Object
  extended by org.codehaus.groovy.grails.web.pages.TagLibraryLookup
All Implemented Interfaces:
GrailsApplicationAware, InitializingBean, ApplicationContextAware

public class TagLibraryLookup
extends Object
implements ApplicationContextAware, GrailsApplicationAware, InitializingBean

Looks up tag library instances.

Since:
1.1
Author:
Graeme Rocher

Constructor Summary
TagLibraryLookup()
           
 
Method Summary
 void afterPropertiesSet()
           
 boolean doesTagReturnObject(String namespace, String tagName)
           
 Set<String> getAvailableNamespaces()
           
 boolean hasNamespace(String namespace)
          Returns whether the given namespace is in use
 org.codehaus.groovy.grails.web.taglib.NamespacedTagDispatcher lookupNamespaceDispatcher(String namespace)
          Looks up a namespace dispatcher for the given namespace
 groovy.lang.GroovyObject lookupTagLibrary(String namespace, String tagName)
          Looks up a tag library for the given namespace and tag name.
 void registerTagLib(GrailsTagLibClass taglib)
          Registers a tag library for lookup.
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setGrailsApplication(GrailsApplication grailsApplication)
          This method is called by the ApplicationContext that loads the Grails application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagLibraryLookup

public TagLibraryLookup()
Method Detail

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

setGrailsApplication

public void setGrailsApplication(GrailsApplication grailsApplication)
Description copied from interface: GrailsApplicationAware

This method is called by the ApplicationContext that loads the Grails application. The GrailsApplication instance that represents the loaded Grails application is injected.

Specified by:
setGrailsApplication in interface GrailsApplicationAware
Parameters:
grailsApplication - the GrailsApplication object that represents this Grails application

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

registerTagLib

public void registerTagLib(GrailsTagLibClass taglib)
Registers a tag library for lookup. Each of the tags in the library is mapped by namespace:name to the taglib bean. If the taglib has already been registered, this method will override the existing information and update the tags to use the new version.

Parameters:
taglib - The taglib descriptor class.

lookupTagLibrary

public groovy.lang.GroovyObject lookupTagLibrary(String namespace,
                                                 String tagName)
Looks up a tag library for the given namespace and tag name.

Parameters:
namespace - The tag library namespace
tagName - The tag name
Returns:
The tag library or null if it wasn't found

doesTagReturnObject

public boolean doesTagReturnObject(String namespace,
                                   String tagName)

lookupNamespaceDispatcher

public org.codehaus.groovy.grails.web.taglib.NamespacedTagDispatcher lookupNamespaceDispatcher(String namespace)
Looks up a namespace dispatcher for the given namespace

Parameters:
namespace - The namespace
Returns:
The NamespacedTagDispatcher

hasNamespace

public boolean hasNamespace(String namespace)
Returns whether the given namespace is in use

Parameters:
namespace - The namespace
Returns:
True if it is in use

getAvailableNamespaces

public Set<String> getAvailableNamespaces()
Returns:
The namespaces available