info.magnolia.freemarker.models
Interface MagnoliaModelFactory

All Superinterfaces:
freemarker.ext.util.ModelFactory
All Known Implementing Classes:
RenderableDefinitionModel.Factory

public interface MagnoliaModelFactory
extends freemarker.ext.util.ModelFactory

A specialization of Freemarker's ModelFactory, which knows which class its handling. Mostly just used so we can simply register other factories in Magnolia's configuration without too many hacks nor billions of subnodes.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Method Summary
 freemarker.template.TemplateModel create(Object object, freemarker.template.ObjectWrapper wrapper)
          If possible, our models should instantiate models which implement AdapterTemplateModel, so they can be unwrapped easily.
 Class factoryFor()
          Returns the Class this ModelFactory is able to create Model instances for.
 

Method Detail

factoryFor

Class factoryFor()
Returns the Class this ModelFactory is able to create Model instances for. MagnoliaObjectWrapper uses this with a isAssignableFrom call to determine which ModelFactory to use.


create

freemarker.template.TemplateModel create(Object object,
                                         freemarker.template.ObjectWrapper wrapper)
If possible, our models should instantiate models which implement AdapterTemplateModel, so they can be unwrapped easily. (by custom directives, for example)

Specified by:
create in interface freemarker.ext.util.ModelFactory
See Also:
AdapterTemplateModel


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.