info.magnolia.dam.asset.model
Class AssetMapModel

java.lang.Object
  extended by info.magnolia.dam.asset.model.AssetMapModel
All Implemented Interfaces:
freemarker.template.AdapterTemplateModel, freemarker.template.TemplateHashModel, freemarker.template.TemplateHashModelEx, freemarker.template.TemplateModel

public class AssetMapModel
extends Object
implements freemarker.template.TemplateHashModelEx, freemarker.template.AdapterTemplateModel

A wrapper for Asset used in FTL to directly access properties (in particular Metadata properties).


Nested Class Summary
static class AssetMapModel.Factory
          Implements a PrioritizedMagnoliaModelFactory in order to be able to configure it via FreemarkerConfig.
 
Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Constructor Summary
AssetMapModel()
           
AssetMapModel(AssetMap assetMap, info.magnolia.freemarker.models.MagnoliaObjectWrapper wrapper)
           
 
Method Summary
 freemarker.template.TemplateModel get(String key)
           
 Object getAdaptedObject(Class hint)
           
 boolean isEmpty()
           
 freemarker.template.TemplateCollectionModel keys()
           
 int size()
           
 freemarker.template.TemplateCollectionModel values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetMapModel

public AssetMapModel()

AssetMapModel

public AssetMapModel(AssetMap assetMap,
                     info.magnolia.freemarker.models.MagnoliaObjectWrapper wrapper)
Method Detail

get

public freemarker.template.TemplateModel get(String key)
                                      throws freemarker.template.TemplateModelException
Specified by:
get in interface freemarker.template.TemplateHashModel
Throws:
freemarker.template.TemplateModelException

isEmpty

public boolean isEmpty()
                throws freemarker.template.TemplateModelException
Specified by:
isEmpty in interface freemarker.template.TemplateHashModel
Throws:
freemarker.template.TemplateModelException

size

public int size()
         throws freemarker.template.TemplateModelException
Specified by:
size in interface freemarker.template.TemplateHashModelEx
Throws:
freemarker.template.TemplateModelException

keys

public freemarker.template.TemplateCollectionModel keys()
                                                 throws freemarker.template.TemplateModelException
Specified by:
keys in interface freemarker.template.TemplateHashModelEx
Throws:
freemarker.template.TemplateModelException

values

public freemarker.template.TemplateCollectionModel values()
                                                   throws freemarker.template.TemplateModelException
Specified by:
values in interface freemarker.template.TemplateHashModelEx
Throws:
freemarker.template.TemplateModelException

getAdaptedObject

public Object getAdaptedObject(Class hint)
Specified by:
getAdaptedObject in interface freemarker.template.AdapterTemplateModel


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.