Package org.apache.tapestry.parse

Examples of org.apache.tapestry.parse.ComponentTemplate


        Locale locale = component.getPage().getLocale();

        Object key = new MultiKey(new Object[] { specificationLocation, locale }, false);

        ComponentTemplate result = searchCache(key);
        if (result != null)
            return result;

        result = findTemplate(cycle, specificationLocation, component, locale);
View Full Code Here


        String name = location.getName();
        int dotx = name.lastIndexOf('.');
        String templateBaseName = name.substring(0, dotx + 1) + getTemplateExtension(component);

        ComponentTemplate result =
            findStandardTemplate(cycle, location, component, templateBaseName, locale);

        if (result == null
            && component.getSpecification().isPageSpecification()
            && component.getNamespace().isApplicationNamespace())
View Full Code Here

        IRequestCycle cycle,
        IResourceLocation location,
        IComponent component)
    {

        ComponentTemplate result = (ComponentTemplate) _templates.get(location);
        if (result != null)
            return result;

        // Ok, see if it exists.
View Full Code Here

        if (LOG.isDebugEnabled())
            LOG.debug("Parsed " + tokens.length + " tokens from template");

        _tokenCount += tokens.length;

        return new ComponentTemplate(templateData, tokens);
    }
View Full Code Here

                    first = false;
                }

                Map.Entry e = (Map.Entry) i.next();
                Object key = e.getKey();
                ComponentTemplate template = (ComponentTemplate) e.getValue();

                writer.begin("li");
                writer.print(key.toString());
                writer.print(" (");
                writer.print(template.getTokenCount());
                writer.print(" tokens)");
                writer.println();
                writer.end();
            }
View Full Code Here

        Iterator i = _templates.values().iterator();

        while (i.hasNext())
        {
            ComponentTemplate template = (ComponentTemplate) i.next();

            templateCount++;

            int count = template.getTokenCount();

            tokenCount += count;

            for (int j = 0; j < count; j++)
            {
                TemplateToken token = template.getToken(j);

                if (token.getType() == TokenType.TEXT)
                {
                    TextToken tt = (TextToken) token;

                    characterCount += tt.getLength();
                }
            }
        }

        event.property("parsed templates", templateCount);
        event.property("total template tokens", tokenCount);
        event.property("total template characters", characterCount);

        event.section("Parsed template token counts");

        i = _templates.entrySet().iterator();

        while (i.hasNext())
        {
            Map.Entry entry = (Map.Entry) i.next();

            String key = entry.getKey().toString();

            ComponentTemplate template = (ComponentTemplate) entry.getValue();

            event.property(key, template.getTokenCount());
        }
    }
View Full Code Here

        Locale locale = component.getPage().getLocale();

        Object key = new MultiKey(new Object[]
        { resource, locale }, false);

        ComponentTemplate result = searchCache(key);
        if (result != null)
            return result;

        result = findTemplate(cycle, resource, component, locale);
View Full Code Here

        String name = resource.getName();
        int dotx = name.lastIndexOf('.');
        String templateExtension = getTemplateExtension(component);
        String templateBaseName = name.substring(0, dotx + 1) + templateExtension;

        ComponentTemplate result = findStandardTemplate(
                cycle,
                resource,
                component,
                templateBaseName,
                locale);
View Full Code Here

    private ComponentTemplate getOrParseTemplate(IRequestCycle cycle, Resource resource,
            IComponent component)
    {

        ComponentTemplate result = (ComponentTemplate) _templates.get(resource);
        if (result != null)
            return result;

        // Ok, see if it exists.
View Full Code Here

        }

        if (_log.isDebugEnabled())
            _log.debug("Parsed " + tokens.length + " tokens from template");

        return new ComponentTemplate(templateData, tokens);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.parse.ComponentTemplate

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.