|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.waffle.testing.view.ViewHarness
public class ViewHarness
Facade that enable processing of views by different template engines. The choice of engine is made based on the extension of the template resource, eg .ftl will trigger use of Freemarker processor.
Constructor Summary | |
---|---|
ViewHarness()
|
|
ViewHarness(java.util.Properties configuration)
|
Method Summary | |
---|---|
static java.lang.String |
decorateView(java.lang.String resource,
java.lang.Object controller,
java.lang.String decoratorsResource,
java.lang.String decoratorName,
java.util.Map<java.lang.String,java.lang.Object> decoratorDataModel)
Decorates a view with Sitemesh and default processor configuration |
static java.lang.String |
decorateView(java.lang.String resource,
java.util.Properties configuration,
java.lang.ClassLoader classLoader,
java.lang.Object controller,
java.lang.String decoratorsResource,
java.lang.String decoratorName,
java.util.Map<java.lang.String,java.lang.Object> decoratorDataModel)
Decorates a view with Sitemesh and custom processor configuration |
static void |
exportView(java.lang.String processed,
java.io.File output)
Exports a view to a file |
static void |
exportView(java.lang.String processed,
java.io.OutputStream output)
Exports a view to an output stream |
java.lang.String |
process(java.lang.String resource,
java.lang.Object controller)
|
java.lang.String |
process(org.codehaus.waffle.testing.view.ViewHarness.Type type,
java.lang.String resource,
java.lang.Object controller)
|
ViewProcessor |
processorFor(java.lang.String resource)
|
ViewProcessor |
processorFor(org.codehaus.waffle.testing.view.ViewHarness.Type type)
|
static java.lang.String |
processView(java.lang.String resource,
java.lang.Object controller,
boolean debug)
Processes a view with default configuration |
static java.lang.String |
processView(java.lang.String resource,
java.util.Properties configuration,
java.lang.Object controller,
boolean debug)
Processes a view with custom configuration |
org.codehaus.waffle.testing.view.ViewHarness.Type |
typeFor(java.lang.String resource)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ViewHarness()
public ViewHarness(java.util.Properties configuration)
Method Detail |
---|
public java.lang.String process(java.lang.String resource, java.lang.Object controller)
public java.lang.String process(org.codehaus.waffle.testing.view.ViewHarness.Type type, java.lang.String resource, java.lang.Object controller)
public ViewProcessor processorFor(java.lang.String resource)
public ViewProcessor processorFor(org.codehaus.waffle.testing.view.ViewHarness.Type type)
public org.codehaus.waffle.testing.view.ViewHarness.Type typeFor(java.lang.String resource)
public static java.lang.String processView(java.lang.String resource, java.lang.Object controller, boolean debug)
resource
- the template resource pathcontroller
- the controller instancedebug
- the debug boolean flag
public static java.lang.String processView(java.lang.String resource, java.util.Properties configuration, java.lang.Object controller, boolean debug)
resource
- the template resource pathconfiguration
- the view processor configurationcontroller
- the controller instancedebug
- the debug boolean flag
public static java.lang.String decorateView(java.lang.String resource, java.lang.Object controller, java.lang.String decoratorsResource, java.lang.String decoratorName, java.util.Map<java.lang.String,java.lang.Object> decoratorDataModel)
resource
- the template resource pathcontroller
- the controller instancedecoratorsResource
- the Sitemesh decorators resourcedecoratorName
- the decorator namedecoratorDataModel
- the decorator data model that can be used to override the processor data model
public static java.lang.String decorateView(java.lang.String resource, java.util.Properties configuration, java.lang.ClassLoader classLoader, java.lang.Object controller, java.lang.String decoratorsResource, java.lang.String decoratorName, java.util.Map<java.lang.String,java.lang.Object> decoratorDataModel)
resource
- the template resource pathconfiguration
- the view processor configurationclassLaoder
- the ClassLoader used to load the decoratorcontroller
- the controller instancedecoratorsResource
- the Sitemesh decorators resourcedecoratorName
- the decorator namedecoratorDataModel
- the decorator data model that can be used to override the processor data model
public static void exportView(java.lang.String processed, java.io.File output) throws java.io.IOException
processed
- the String encoding the processed viewoutput
- the File to export view to
java.io.IOException
public static void exportView(java.lang.String processed, java.io.OutputStream output) throws java.io.IOException
processed
- the String encoding the processed viewoutput
- the OutputStream to export view to
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |