diff options
author | James Moger <james.moger@gitblit.com> | 2013-09-30 09:30:04 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-09-30 10:11:28 -0400 |
commit | 699e71e76b15081baf746c6ce9c9144f7e5f1ff9 (patch) | |
tree | 4a9ea25c258caeae3dea4bc1de809f47bc615d81 /src/main/java/com/gitblit/wicket/freemarker | |
parent | 235ad956fa84cad4fac1b2e69a0c9e4f50376ea3 (diff) | |
download | gitblit-699e71e76b15081baf746c6ce9c9144f7e5f1ff9.tar.gz gitblit-699e71e76b15081baf746c6ce9c9144f7e5f1ff9.zip |
Trim trailing whitespace and organize imports
Change-Id: I9f91138b20219be6e3c4b28251487df262bff6cc
Diffstat (limited to 'src/main/java/com/gitblit/wicket/freemarker')
-rw-r--r-- | src/main/java/com/gitblit/wicket/freemarker/Freemarker.java | 6 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/freemarker/FreemarkerPanel.java | 26 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/main/java/com/gitblit/wicket/freemarker/Freemarker.java b/src/main/java/com/gitblit/wicket/freemarker/Freemarker.java index ad7aa964..a9b827aa 100644 --- a/src/main/java/com/gitblit/wicket/freemarker/Freemarker.java +++ b/src/main/java/com/gitblit/wicket/freemarker/Freemarker.java @@ -27,18 +27,18 @@ import freemarker.template.TemplateException; public class Freemarker {
private static final Configuration fm;
-
+
static {
fm = new Configuration();
fm.setObjectWrapper(new DefaultObjectWrapper());
fm.setOutputEncoding("UTF-8");
fm.setClassForTemplateLoading(Freemarker.class, "templates");
}
-
+
public static Template getTemplate(String name) throws IOException {
return fm.getTemplate(name);
}
-
+
public static void evaluate(Template template, Map<String, Object> values, Writer out) throws TemplateException, IOException {
template.process(values, out);
}
diff --git a/src/main/java/com/gitblit/wicket/freemarker/FreemarkerPanel.java b/src/main/java/com/gitblit/wicket/freemarker/FreemarkerPanel.java index d57c3a09..aaf1a135 100644 --- a/src/main/java/com/gitblit/wicket/freemarker/FreemarkerPanel.java +++ b/src/main/java/com/gitblit/wicket/freemarker/FreemarkerPanel.java @@ -43,9 +43,9 @@ import freemarker.template.TemplateException; * snippet injector for something like a CMS. There are some cases where Wicket
* is not flexible enough to generate content, especially when you need to generate
* hybrid HTML/JS content outside the scope of Wicket.
- *
+ *
* @author James Moger
- *
+ *
*/
@SuppressWarnings("unchecked")
public class FreemarkerPanel extends Panel
@@ -62,10 +62,10 @@ public class FreemarkerPanel extends Panel private transient String stackTraceAsString;
private transient String evaluatedTemplate;
-
+
/**
* Construct.
- *
+ *
* @param id
* Component id
* @param template
@@ -77,10 +77,10 @@ public class FreemarkerPanel extends Panel {
this(id, template, Model.ofMap(values));
}
-
+
/**
* Construct.
- *
+ *
* @param id
* Component id
* @param templateResource
@@ -96,7 +96,7 @@ public class FreemarkerPanel extends Panel /**
* Gets the Freemarker template.
- *
+ *
* @return the Freemarker template
*/
private Template getTemplate()
@@ -155,7 +155,7 @@ public class FreemarkerPanel extends Panel /**
* Either print or rethrow the throwable.
- *
+ *
* @param exception
* the cause
* @param markupStream
@@ -179,7 +179,7 @@ public class FreemarkerPanel extends Panel /**
* Gets whether to escape HTML characters.
- *
+ *
* @return whether to escape HTML characters. The default value is false.
*/
public void setEscapeHtml(boolean value)
@@ -189,7 +189,7 @@ public class FreemarkerPanel extends Panel /**
* Evaluates the template and returns the result.
- *
+ *
* @param templateReader
* used to read the template
* @return the result of evaluating the velocity template
@@ -237,7 +237,7 @@ public class FreemarkerPanel extends Panel /**
* Gets whether to parse the resulting Wicket markup.
- *
+ *
* @return whether to parse the resulting Wicket markup. The default is false.
*/
public void setParseGeneratedMarkup(boolean value)
@@ -256,7 +256,7 @@ public class FreemarkerPanel extends Panel * want them to be able to have them correct them while the rest of the application keeps on
* working.
* </p>
- *
+ *
* @return Whether any Freemarker exceptions should be thrown or trapped. The default is false.
*/
public void setThrowFreemarkerExceptions(boolean value)
@@ -268,6 +268,7 @@ public class FreemarkerPanel extends Panel * @see org.apache.wicket.markup.IMarkupResourceStreamProvider#getMarkupResourceStream(org.apache
* .wicket.MarkupContainer, java.lang.Class)
*/
+ @Override
public final IResourceStream getMarkupResourceStream(MarkupContainer container,
Class< ? > containerClass)
{
@@ -289,6 +290,7 @@ public class FreemarkerPanel extends Panel * @see org.apache.wicket.markup.IMarkupCacheKeyProvider#getCacheKey(org.apache.wicket.
* MarkupContainer, java.lang.Class)
*/
+ @Override
public final String getCacheKey(MarkupContainer container, Class< ? > containerClass)
{
// don't cache the evaluated template
|