Package gap.hapax

Examples of gap.hapax.Template


    }
    private TemplateRenderer getTemplate(String path)
        throws TemplateException
    {
        jauk.Resource templateResource = new jauk.Resource(path,ResourcePrefix,ResourceSuffix);
        Template template = this.get(templateResource);
        if (null == template){
            template = new Template(path);
            jauk.Resource templateFileResource = new jauk.Resource(ResourceDir,templateResource);
            try {
                template.setTemplateSourceHapax(gap.Strings.TextFromString(ReadToString(templateFileResource)));
                template.setLastModified(templateFileResource.getLastModified());
                this.put(templateResource,template);

                return new gap.hapax.TemplateRendererImpl(this,template);
            }
            catch (IOException tryresource){
                try {
                    template.setTemplateSourceHapax(gap.Strings.TextFromString(ReadToString(templateResource)));
                    template.setLastModified(templateResource.getLastModified());
                    this.put(templateResource,template);

                    return new gap.hapax.TemplateRendererImpl(this,template);
                }
                catch (IOException iox){
View Full Code Here


     * Lookup Existing Template
     */
    protected Template peek(String name)
        throws TemplateException
    {
        Template template = Template.ForLongName(name);
        // if (null == template)
        //     template = Template.ForLongName(name+".xtm");

        return template;
    }
View Full Code Here

     * Validate Existing Template Content
     */
    protected boolean validate(String name)
        throws TemplateException
    {
        Template template = this.peek(name);
        if (null != template){

            Text source = template.getTemplateSourceHapax();
            String target = template.toString();

            if (null != source && null != target && target.equals(source.getValue()))
                return true;
            else if (null == source)
                throw new TemplateException(String.format("Missing source for '%s'",name));
View Full Code Here

TOP

Related Classes of gap.hapax.Template

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.