In package com.eden.orchid.api.compilers

@Extensible
public abstract class TemplateFunction extends Object implements OptionsHolder

since: v1.0.0 public abstract

Template Functions add methods that can be called by themselves or as a "filter" in an expression within the primary template language.

Fields

String name final
Field Annotations:
@Getter

boolean isSafe final
Field Annotations:
@Getter

OrchidPage page
Field Annotations:
@Getter,
@Setter

Constructors

TemplateFunction(String name, boolean isSafe) public

Initialize the Function with the name which it should be called with in the template., and whether Whether this Function returns "safe" HTML that should not be escaped by default. For filters that return anything other than a String, `isSafe` should always be false. The actual implementation of a Function should have a single constructor annotated with {@link javax.inject.Inject }.

Parameters:
  • String name

    the name which to call this Function
  • isSafe

Methods

String parameters() abstract public

The sequential parameters of this function

Object apply() abstract public

Apply the filter or function here, returning the created or modified data.