Class T9nFilter

  • All Implemented Interfaces:
    com.mitchellbosecke.pebble.extension.Filter, com.mitchellbosecke.pebble.extension.NamedArguments

    public final class T9nFilter
    extends java.lang.Object
    implements com.mitchellbosecke.pebble.extension.Filter
    This filter perform string translation by previously loaded dictionary (with t9nDictionary tag)

    Filter usage example: {{ "myStringKey" | t9n }} - for dictionary name 'messages' {{ "myStringKey" | t9n(myName) }} - for dictionary name 'myName' {{ "myStringKey" | t9n([param1, param2]) }} - for dictionary name 'messages' {{ "myStringKey" | t9n(myName,[param1, param2]) }} - for dictionary name 'myName'

    Author:
    Vladlen Larionov
    See Also:
    T9nDictionaryParser
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FILTER_NAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      T9nFilter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object apply​(java.lang.Object input, java.util.Map<java.lang.String,​java.lang.Object> args, com.mitchellbosecke.pebble.template.PebbleTemplate pebbleTemplate, com.mitchellbosecke.pebble.template.EvaluationContext evaluationContext, int lineNumber)  
      java.util.List<java.lang.String> getArgumentNames()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • T9nFilter

        public T9nFilter()
    • Method Detail

      • getArgumentNames

        public java.util.List<java.lang.String> getArgumentNames()
        Specified by:
        getArgumentNames in interface com.mitchellbosecke.pebble.extension.NamedArguments
      • apply

        public java.lang.Object apply​(java.lang.Object input,
                                      java.util.Map<java.lang.String,​java.lang.Object> args,
                                      com.mitchellbosecke.pebble.template.PebbleTemplate pebbleTemplate,
                                      com.mitchellbosecke.pebble.template.EvaluationContext evaluationContext,
                                      int lineNumber)
                               throws com.mitchellbosecke.pebble.error.PebbleException
        Specified by:
        apply in interface com.mitchellbosecke.pebble.extension.Filter
        Throws:
        com.mitchellbosecke.pebble.error.PebbleException