com.github.mustachejava.codes
Class PartialCode

java.lang.Object
  extended by com.github.mustachejava.codes.DefaultCode
      extended by com.github.mustachejava.codes.PartialCode
All Implemented Interfaces:
Code
Direct Known Subclasses:
ExtendCode

public class PartialCode
extends DefaultCode


Field Summary
protected  java.lang.String extension
           
protected  Mustache partial
           
 
Fields inherited from class com.github.mustachejava.codes.DefaultCode
appended, debug, logger, mustache, name, oh, returnThis, tc, type
 
Constructor Summary
protected PartialCode(TemplateContext tc, DefaultMustacheFactory cf, Mustache mustache, java.lang.String type, java.lang.String variable)
           
  PartialCode(TemplateContext tc, DefaultMustacheFactory cf, java.lang.String variable)
           
 
Method Summary
 java.io.Writer execute(java.io.Writer writer, java.lang.Object[] scopes)
          The default behavior is to run the codes and append the captured text.
protected  java.io.Writer execute(java.io.Writer writer, java.lang.Object scope, java.lang.Object[] scopes)
           
 Code[] getCodes()
           
 void init()
           
protected  java.io.Writer partialExecute(java.io.Writer writer, java.lang.Object[] scopes)
           
protected  java.lang.String partialName()
          Builds the file name to be included by this partial tag.
 void setCodes(Code[] newcodes)
           
 
Methods inherited from class com.github.mustachejava.codes.DefaultCode
addScope, append, appendText, execute, get, getWrapper, identity, runCodes, runIdentity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extension

protected final java.lang.String extension

partial

protected Mustache partial
Constructor Detail

PartialCode

protected PartialCode(TemplateContext tc,
                      DefaultMustacheFactory cf,
                      Mustache mustache,
                      java.lang.String type,
                      java.lang.String variable)

PartialCode

public PartialCode(TemplateContext tc,
                   DefaultMustacheFactory cf,
                   java.lang.String variable)
Method Detail

getCodes

public Code[] getCodes()
Specified by:
getCodes in interface Code
Overrides:
getCodes in class DefaultCode

setCodes

public void setCodes(Code[] newcodes)
Specified by:
setCodes in interface Code
Overrides:
setCodes in class DefaultCode

execute

public java.io.Writer execute(java.io.Writer writer,
                              java.lang.Object[] scopes)
Description copied from class: DefaultCode
The default behavior is to run the codes and append the captured text.

Specified by:
execute in interface Code
Overrides:
execute in class DefaultCode
Parameters:
writer - The writer to write the output to
scopes - The scopes to evaluate the embedded names against.

init

public void init()
Specified by:
init in interface Code
Overrides:
init in class DefaultCode

partialName

protected java.lang.String partialName()
Builds the file name to be included by this partial tag. Default implementation ppends the tag contents with the current file's extension.

Returns:
The filename to be included by this partial tag

partialExecute

protected java.io.Writer partialExecute(java.io.Writer writer,
                                        java.lang.Object[] scopes)

execute

protected java.io.Writer execute(java.io.Writer writer,
                                 java.lang.Object scope,
                                 java.lang.Object[] scopes)


Copyright © 2012. All Rights Reserved.