Class SiteContextHashModel

  • All Implemented Interfaces:
    freemarker.template.TemplateHashModel, freemarker.template.TemplateHashModelEx, freemarker.template.TemplateModel

    public class SiteContextHashModel
    extends Object
    implements freemarker.template.TemplateHashModelEx
    Implementation of TemplateHashModelEx to safely expose the SiteContext instance in templates
    Since:
    3.1.7
    Author:
    joseross
    • Field Detail

      • objectWrapper

        protected freemarker.template.ObjectWrapper objectWrapper
    • Constructor Detail

      • SiteContextHashModel

        public SiteContextHashModel​(freemarker.template.ObjectWrapper objectWrapper)
    • Method Detail

      • 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
      • 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()
        Specified by:
        isEmpty in interface freemarker.template.TemplateHashModel