Register escapers or filters.
A class that is annotated represents a content type such as Html and will be used as a
factory for creating escapers as well as a marker for the content type.
There are two supported escaper types:
io.jstach.api.runtime.Escaper
java.util.function.Function<String,String>
On the otherhand the Escaper interfaces allows potentially greater performance if you need to escape native types. n.b. the class annotated does not need to implement the interfaces
- Author:
- agentgt, Victor Nazarov
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A sentinel null object content type marker to auto resolve the content type based on config found elsewhere. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionString[]
The charsets supported by the escaper.Media Type of the template to help in renderer lookup.A static method that will return an implementation ofio.jstach.api.runtime.Escaper
orFunction<String,String>
-
Element Details
-
providesMethod
A static method that will return an implementation ofio.jstach.api.runtime.Escaper
orFunction<String,String>
- Returns:
- default method name is
provider
just like theServiceLoader
- Default:
- "provider"
-
mediaType
Media Type of the template to help in renderer lookup. The media type information should not include the charset parameter ifcharsets()
is set also for some media types the charset is inherent (e.g. application/json is inherently UTF-8) and should not be included.- Returns:
- media type of the template or empty string no media type
- Default:
- ""
-
charsets
The charsets supported by the escaper. If the template is encoded with a different charset a warning will be ommited by the compiler.- Returns:
- supported charsets.
- Default:
- {}
-