-
Notifications
You must be signed in to change notification settings - Fork 284
Expand file tree
/
Copy pathSpecMustacheFactory.java
More file actions
47 lines (39 loc) · 1.22 KB
/
SpecMustacheFactory.java
File metadata and controls
47 lines (39 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.github.mustachejava;
import com.github.mustachejava.resolver.DefaultResolver;
import java.io.File;
/**
* This factory is similar to DefaultMustacheFactory but handles whitespace according to the mustache specification.
* Therefore the rendering is less performant than with the DefaultMustacheFactory.
*/
public class SpecMustacheFactory extends DefaultMustacheFactory {
@Override
public MustacheVisitor createMustacheVisitor() {
return new SpecMustacheVisitor(this);
}
public SpecMustacheFactory() {
super();
}
public SpecMustacheFactory(MustacheResolver mustacheResolver) {
super(mustacheResolver);
}
/**
* Use the classpath to resolve mustache templates.
*
* @param classpathResourceRoot the location in the resources where templates are stored
*/
public SpecMustacheFactory(String classpathResourceRoot) {
super(classpathResourceRoot);
}
/**
* Use the file system to resolve mustache templates.
*
* @param fileRoot the root of the file system where templates are stored
*/
public SpecMustacheFactory(File fileRoot) {
super(fileRoot);
}
@Override
protected MustacheParser createParser() {
return new MustacheParser(this, true);
}
}