com.github.mustachejava
Interface MustacheFactory

All Known Implementing Classes:
DefaultMustacheFactory, DeferringMustacheFactory

public interface MustacheFactory

Factory for creating codes


Method Summary
 Mustache compile(java.io.Reader reader, java.lang.String name)
          Create a mustache given a reader and a name.
 Mustache compile(java.lang.String name)
          Create a mustache given a resource name.
 MustacheVisitor createMustacheVisitor()
          Creates the visitor for compilation.
 void encode(java.lang.String value, java.io.Writer writer)
          This defines how "encoded" values are encoded.
 ObjectHandler getObjectHandler()
          The object handler knows how to transform names into fields and methods.
 java.io.Reader getReader(java.lang.String resourceName)
          Given a resource name, construct a reader.
 java.lang.String translate(java.lang.String from)
          Converts your arbitrary name to another name.
 

Method Detail

createMustacheVisitor

MustacheVisitor createMustacheVisitor()
Creates the visitor for compilation.

Returns:
visitor

getReader

java.io.Reader getReader(java.lang.String resourceName)
Given a resource name, construct a reader.

Parameters:
resourceName - used to find the resource
Returns:
a reader

encode

void encode(java.lang.String value,
            java.io.Writer writer)
This defines how "encoded" values are encoded. It defaults to something appropriate for HTML output.

Parameters:
value - the unencoded value
writer - where to encode the value

getObjectHandler

ObjectHandler getObjectHandler()
The object handler knows how to transform names into fields and methods.

Returns:
the handler

compile

Mustache compile(java.lang.String name)
Create a mustache given a resource name.

Parameters:
name - the name of the resource
Returns:
the compiled mustache

compile

Mustache compile(java.io.Reader reader,
                 java.lang.String name)
Create a mustache given a reader and a name.

Parameters:
reader - the reader
name - the name of the resource
Returns:
the compiled mustache

translate

java.lang.String translate(java.lang.String from)
Converts your arbitrary name to another name.

Parameters:
from - the tag to replace
Returns:
the new tag


Copyright © 2012. All Rights Reserved.