Class TitlecaseLambda

  • All Implemented Interfaces:
    com.samskivert.mustache.Mustache.Lambda

    public class TitlecaseLambda
    extends Object
    implements com.samskivert.mustache.Mustache.Lambda
    Converts text in a fragment to title case. Register:
     additionalProperties.put("titlecase", new TitlecaseLambda());
     
    Use:
     {{#titlecase}}{{classname}}{{/titlecase}}
     
    • Constructor Detail

      • TitlecaseLambda

        public TitlecaseLambda()
        Constructs a new instance of TitlecaseLambda, which will convert all text in a space delimited string to title-case.
      • TitlecaseLambda

        public TitlecaseLambda​(String delimiter)
        Constructs a new instance of TitlecaseLambda, splitting on the specified delimiter and converting each word to title-case. NOTE: passing null results in a title-casing the first word only.
        Parameters:
        delimiter - Provided to allow an override for the default space delimiter.
    • Method Detail

      • execute

        public void execute​(com.samskivert.mustache.Template.Fragment fragment,
                            Writer writer)
                     throws IOException
        Specified by:
        execute in interface com.samskivert.mustache.Mustache.Lambda
        Throws:
        IOException