Packages

c

gnieh.mustache

MustacheProcessor

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MustacheProcessor
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MustacheProcessor(loader: MustacheLoader, resident: Boolean = false)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  11. def invalidate(name: String): Unit

    Invalidate the template with the given name in cache.

  12. def invalidateAll(): Unit

    Invalidates all the templates in the cache.

  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. 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.

  15. 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 force is set to true.

  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  19. def render(instrs: List[Statement], value: Map[String, Any]): String

    Render the template given as a list of statements.

  20. 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.

  21. 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.

  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped