mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
added method to read templates from a reader
This commit is contained in:
@@ -30,28 +30,30 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.template;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
|
||||
/**
|
||||
* The {@link TemplateEngine} searches for {@link Template}s and prepares the
|
||||
* The {@link TemplateEngine} searches for {@link Template}s and prepares the
|
||||
* template for the rendering process.
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
* @since 1.19
|
||||
*
|
||||
*
|
||||
* @apiviz.uses sonia.scm.template.Template
|
||||
*/
|
||||
public interface TemplateEngine
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns the template associated with the given path. The template engine
|
||||
* will search the template in the folder of the web application and in
|
||||
* the classpath. This method will return null,
|
||||
* Returns the template associated with the given path. The template engine
|
||||
* will search the template in the folder of the web application and in
|
||||
* the classpath. This method will return null,
|
||||
* if no template could be found for the given path.
|
||||
*
|
||||
*
|
||||
@@ -63,6 +65,23 @@ public interface TemplateEngine
|
||||
*/
|
||||
public Template getTemplate(String templatePath) throws IOException;
|
||||
|
||||
/**
|
||||
* Creates a template of the given reader. Note some template implementations
|
||||
* will cache the template by its id.
|
||||
*
|
||||
*
|
||||
* @param templateIdentifier id of the template
|
||||
* @param reader template reader
|
||||
*
|
||||
* @return template created from the reader
|
||||
*
|
||||
* @throws IOException
|
||||
*
|
||||
* @since 1.22
|
||||
*/
|
||||
public Template getTemplate(String templateIdentifier, Reader reader)
|
||||
throws IOException;
|
||||
|
||||
/**
|
||||
* Returns the type of this template engine.
|
||||
*
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
package sonia.scm.template;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -43,6 +44,7 @@ import static org.junit.Assert.*;
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
@@ -166,6 +168,24 @@ public class TemplateEngineFactoryTest
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param templateIdentifier
|
||||
* @param reader
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public Template getTemplate(String templateIdentifier, Reader reader)
|
||||
throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -190,6 +210,24 @@ public class TemplateEngineFactoryTest
|
||||
private static class FakeTemplateEngine2 implements TemplateEngine
|
||||
{
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param templateIdentifier
|
||||
* @param reader
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
public Template getTemplate(String templateIdentifier, Reader reader)
|
||||
throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user