Package org.grails.web.taglib

Examples of org.grails.web.taglib.NamespacedTagDispatcher


    @Override
    protected void registerTagLibraries() {
        List<Class> providedArtefacts = (List<Class>) new GroovyPagesGrailsPlugin().getProvidedArtefacts();

        tagClassesByNamespace.put(GrailsTagLibClass.DEFAULT_NAMESPACE, new ArrayList<Class>());
        namespaceDispatchers.put(GrailsTagLibClass.DEFAULT_NAMESPACE, new NamespacedTagDispatcher(GrailsTagLibClass.DEFAULT_NAMESPACE, GroovyPage.class, grailsApplication, this));
        for (Class providedArtefact : providedArtefacts) {
            if (!grailsApplication.isArtefactOfType(TagLibArtefactHandler.TYPE, providedArtefact)) continue;
            Object value = GrailsClassUtils.getStaticPropertyValue(providedArtefact, GrailsTagLibClass.NAMESPACE_FIELD_NAME);
            if (value != null) {

                String namespace = value.toString();
                List<Class> classes = tagClassesByNamespace.get(namespace);
                if (classes == null) {
                    classes = new ArrayList<Class>();
                    tagClassesByNamespace.put(namespace, classes);
                }
                classes.add(providedArtefact);

                namespaceDispatchers.put(namespace, new NamespacedTagDispatcher(namespace, GroovyPage.class, grailsApplication, this));
            }
            else {
                tagClassesByNamespace.get(GrailsTagLibClass.DEFAULT_NAMESPACE).add(providedArtefact);
            }
        }
View Full Code Here


     * @param propertyName The property name
     * @return The namespace or a MissingPropertyException
     */
    public Object propertyMissing(Object instance, String propertyName) {
        TagLibraryLookup lookup = getTagLibraryLookup();
        NamespacedTagDispatcher namespacedTagDispatcher = lookup.lookupNamespaceDispatcher(propertyName);
        if (namespacedTagDispatcher != null) {
            if (!developmentMode) {
                TagLibraryMetaUtils.registerPropertyMissingForTag(GrailsMetaClassUtils.getMetaClass(instance),propertyName, namespacedTagDispatcher);
            }
            return namespacedTagDispatcher;
View Full Code Here

TOP

Related Classes of org.grails.web.taglib.NamespacedTagDispatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.