com.anrisoftware.resources.templates.worker.STTemplateWorkerFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resources-st Show documentation
Show all versions of resources-st Show documentation
Loads and caches ST4 resources.
/*
* Copyright 2012-2016 Erwin Müller
*
* This file is part of resources-st.
*
* resources-st is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* resources-st is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with resources-st. If not, see .
*/
package com.anrisoftware.resources.templates.worker;
import java.io.Serializable;
import java.net.URL;
import java.util.Map;
import java.util.Properties;
import com.anrisoftware.resources.templates.api.AttributeRenderer;
import com.anrisoftware.resources.templates.api.TemplateWorker;
import com.anrisoftware.resources.templates.api.TemplateWorkerFactory;
/**
* Factory to create a new template worker that is using a String
* Template template engine.
*
* @author Erwin Mueller, [email protected]
* @since 1.0
*/
public interface STTemplateWorkerFactory extends TemplateWorkerFactory {
static final String DELIMITER_STOP_CHAR_PROPERTY = "template_delimiter_stop_character";
static final String DELIMITER_START_CHAR_PROPERTY = "template_delimiter_start_character";
static final String ENCODING_PROPERTY = "template_encoding";
/**
* The map key for the attribute renderers.
*
* @see AttributeRenderer
*/
static final String RENDERERS_KEY = "renderers";
/**
* Creates a new template worker that is using a String Template template
* engine.
*
* @param templateUrl
* the {@link URL} of the template group file.
*
* @param properties
* the {@link Properties} for the template group file. Have the
* properties:
*
* - {@value #ENCODING_PROPERTY}
* - {@value #DELIMITER_START_CHAR_PROPERTY}
* - {@value #DELIMITER_STOP_CHAR_PROPERTY}
*
*
* @param attributes
* the attributes {@link Map} for the template. Can contain the
* attribute renderers in the map key {@link RENDERERS_KEY}.
*
*
* @return the {@link TemplateWorker}.
*/
@Override
TemplateWorker create(URL templateUrl, Properties properties,
Map attributes);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy