Search in sources :

Example 1 with DefaultGrailsTagLibClass

use of org.grails.core.DefaultGrailsTagLibClass in project grails-core by grails.

the class StandaloneTagLibraryLookup method detectAndRegisterTabLibBeans.

public void detectAndRegisterTabLibBeans() {
    if (tagLibInstancesSet == null) {
        tagLibInstancesSet = new LinkedHashSet<Object>();
    }
    Collection<Object> detectedInstances = applicationContext.getBeansWithAnnotation(TagLib.class).values();
    for (Object instance : detectedInstances) {
        if (!tagLibInstancesSet.contains(instance)) {
            tagLibInstancesSet.add(instance);
            registerTagLib(new DefaultGrailsTagLibClass(instance.getClass()));
        }
    }
}
Also used : TagLib(grails.gsp.TagLib) DefaultGrailsTagLibClass(org.grails.core.DefaultGrailsTagLibClass)

Example 2 with DefaultGrailsTagLibClass

use of org.grails.core.DefaultGrailsTagLibClass in project grails-core by grails.

the class LazyTagLibraryLookup method registerLazyLoadableTagLibClass.

public void registerLazyLoadableTagLibClass(Class tagLibClass) {
    GrailsTagLibClass grailsTagLibClass = new DefaultGrailsTagLibClass(tagLibClass);
    if (!hasNamespace(grailsTagLibClass.getNamespace())) {
        registerNamespaceDispatcher(grailsTagLibClass.getNamespace());
    }
    for (String tagName : grailsTagLibClass.getTagNames()) {
        String tagKey = tagNameKey(grailsTagLibClass.getNamespace(), tagName);
        lazyLoadableTagLibs.put(tagKey, grailsTagLibClass);
    }
}
Also used : DefaultGrailsTagLibClass(org.grails.core.DefaultGrailsTagLibClass) GrailsTagLibClass(grails.core.GrailsTagLibClass) DefaultGrailsTagLibClass(org.grails.core.DefaultGrailsTagLibClass)

Aggregations

DefaultGrailsTagLibClass (org.grails.core.DefaultGrailsTagLibClass)2 GrailsTagLibClass (grails.core.GrailsTagLibClass)1 TagLib (grails.gsp.TagLib)1