class MustacheProcessor extends AnyRef
A mustache processor is able to process templates from several sources from classpath or filesystem, or even programmatically built.
This processor does not presume any file extension for templates. You
can load files with any extension and it assumes it is a mustache template file.
So the simple case where you say "load my template file named my-template.txt in
directory dir" simply works as you expect it to work. No magic there to add
implicit file extension, no complex classpath lookup.
You can actually implement the loading strategy of your choice by implementing
gnieh.mustache.MustacheLoader.
By default we provide simple strategies that lookup for files in a directrory or in
the classpath as well as a composition strategy.
If the processor is said to be resident, it caches the templates for more efficient rendering later on. Cache is never automatically invalidated, this is a simple processor. You can either invalidate a specific template manually, or clean the entire cache at once.
- Alphabetic
- By Inheritance
- MustacheProcessor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new MustacheProcessor(loader: MustacheLoader, resident: Boolean = false)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
invalidate(name: String): Unit
Invalidate the template with the given name in cache.
-
def
invalidateAll(): Unit
Invalidates all the templates in the cache.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lastTimeCached(name: String): Option[Long]
Returns the last time the given template was loaded into the cache if it is cached.
Returns the last time the given template was loaded into the cache if it is cached. Returns the number of milliseconds between the current time and midnight, January 1, 1970 UTC.
-
def
load(name: String, force: Boolean = false): List[Statement]
Load a template and returns its representation.
Load a template and returns its representation. If the template was cached, this version is returned unles
forceis set totrue. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
render(instrs: List[Statement], value: Map[String, Any]): String
Render the template given as a list of statements.
-
def
render(name: String, values: Map[String, Any]): String
Render the template with the given name.
Render the template with the given name. The name is the complete template file name including the extension. No extension is added to the name.
-
def
renderString(template: String, values: Map[String, Any]): String
Render the template given as a string.
Render the template given as a string. The parsed template is not cached, hence each call to this method with the same string parses the string.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Gnieh Tekstlib
Gnieh Tekstlib is a library grouping standard classes and packages allowing people to work with texts and documents.
Package Structure
gnieh.diffdiff manipulation,gnieh.hyphenhyphenation for text in any language,gnieh.stringstrings manipulation for text processing,gnieh.mustachelightweight mustache template engine,gnieh.pppretty printing related classes,gnieh.regexregular expressions manipulation.