public class Meepo extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CACHE_ALWAYS |
static int |
CACHE_DAY |
static int |
CACHE_HOUR |
static int |
CACHE_MINUTE |
static int |
CACHE_MONTH |
static int |
CACHE_NEVER |
| Constructor and Description |
|---|
Meepo() |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull Gene |
cache(@NotNull String key,
@NotNull Supplier<Gene> gen,
int ttl) |
static @NotNull String |
merge(@NotNull Map<String,Object> ctx,
@NotNull File file)
Parse and cache (ttl=CACHE_ALWAYS) the template form file, then merge with the context.
|
static @NotNull String |
merge(@NotNull Map<String,Object> ctx,
@NotNull File file,
int ttl)
Parse and cache the template form file, then merge with the context.
|
static @NotNull String |
merge(@NotNull Map<String,Object> ctx,
@NotNull String uri)
Parse and cache (ttl=CACHE_ALWAYS) the template form URI, then merge with the context.
|
static @NotNull String |
merge(@NotNull Map<String,Object> ctx,
@NotNull String key,
@NotNull InputStream ins)
Parse and cache (ttl=CACHE_ALWAYS) the template form stream, then merge with the context.
|
static @NotNull String |
merge(@NotNull Map<String,Object> ctx,
@NotNull String key,
@NotNull InputStream ins,
int ttl)
Parse and cache the template form stream, then merge with the context.
|
static @NotNull String |
merge(@NotNull Map<String,Object> ctx,
@NotNull String uri,
int ttl)
Parse and cache the template form URI, then merge with the context.
|
static @NotNull String |
merge(@NotNull Map<String,Object> ctx,
@NotNull String key,
@NotNull String txt)
Parse and cache (ttl=CACHE_ALWAYS) the template text, then merge with the context.
|
static @NotNull String |
merge(@NotNull Map<String,Object> ctx,
@NotNull String key,
@NotNull String txt,
int ttl)
Parse and cache the template text, then merge with the context.
|
static @NotNull Gene |
parse(@NotNull File file)
Parses from file and cache by its path with ttl=CACHE_ALWAYS
|
static @NotNull Gene |
parse(@NotNull File file,
int ttl)
Parses from file and cache by its path with the given ttl.
|
static @NotNull Gene |
parse(@NotNull String uri)
Parse form the URI with ttl=CACHE_ALWAYS
URI support `file://`,`classpath:`,`http://`
|
static @NotNull Gene |
parse(@NotNull String key,
@NotNull InputStream ins)
Parses from stream and cache by its path with ttl=CACHE_ALWAYS
|
static @NotNull Gene |
parse(@NotNull String key,
@NotNull InputStream ins,
int ttl)
Parses from stream and cache by its path with the given ttl.
|
static @NotNull Gene |
parse(@NotNull String uri,
int ttl)
Parse form the URI with the given ttl.
|
static @NotNull Gene |
parse(@NotNull String key,
@NotNull String txt)
Parses text directly and cache by key with ttl=CACHE_ALWAYS
|
static @NotNull Gene |
parse(@NotNull String key,
@NotNull String txt,
int ttl)
Parses text directly and cache by key with the given ttl.
|
static @NotNull String |
piece(@NotNull Map<String,Object> ctx,
@NotNull String txt)
Parse and cache (ttl=CACHE_ALWAYS) the template, then merge with the context.
|
static @NotNull String |
piece(@NotNull Map<String,Object> ctx,
@NotNull String txt,
int ttl)
Parse and cache the template, then merge with the context.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull File file)
Parse and cache (ttl=CACHE_ALWAYS) the template from file, then merge with the context to stream.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull File file,
int ttl)
Parse and cache the template from file, then merge with the context to stream.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull Gene gene)
Merge the Gene with the context to stream.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull String uri)
Parse and cache (ttl=CACHE_ALWAYS) the template form URI, then merge with the context to stream.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull String key,
@NotNull InputStream ins)
Parse and cache (ttl=CACHE_ALWAYS) the template form stream, then merge with the context to stream.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull String key,
@NotNull InputStream ins,
int ttl)
Parse and cache the template form stream, then merge with the context to stream.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull String uri,
int ttl)
Parse and cache the template form URI, then merge with the context to stream.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull String key,
String txt)
Parse and cache (ttl=CACHE_ALWAYS) the template text, then merge with the context to stream.
|
static @NotNull InputStream |
steam(@NotNull Map<String,Object> ctx,
@NotNull String key,
@NotNull String txt,
int ttl)
Parse and cache the template text, then merge with the context to stream.
|
public static final int CACHE_ALWAYS
public static final int CACHE_NEVER
public static final int CACHE_MINUTE
public static final int CACHE_HOUR
public static final int CACHE_DAY
public static final int CACHE_MONTH
@NotNull public static @NotNull Gene parse(@NotNull @NotNull String uri)
@NotNull public static @NotNull Gene parse(@NotNull @NotNull String uri, int ttl)
@NotNull public static @NotNull Gene parse(@NotNull @NotNull String key, @NotNull @NotNull String txt)
@NotNull public static @NotNull Gene parse(@NotNull @NotNull String key, @NotNull @NotNull String txt, int ttl)
@NotNull public static @NotNull Gene parse(@NotNull @NotNull File file)
@NotNull public static @NotNull Gene parse(@NotNull @NotNull File file, int ttl)
@NotNull public static @NotNull Gene parse(@NotNull @NotNull String key, @NotNull @NotNull InputStream ins)
@NotNull public static @NotNull Gene parse(@NotNull @NotNull String key, @NotNull @NotNull InputStream ins, int ttl)
@NotNull public static @NotNull String piece(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String txt)
ctx - the contexttxt - placeholder templatepiece(Map, String, int)@NotNull public static @NotNull String piece(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String txt, int ttl)
ctx - the contexttxt - placeholder templatettl - cache ttlparse(String, int),
Holder.parse(String)@NotNull public static @NotNull Gene cache(@NotNull @NotNull String key, @NotNull @NotNull Supplier<Gene> gen, int ttl)
@NotNull public static @NotNull String merge(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String uri)
parse(String, int)@NotNull public static @NotNull String merge(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String uri, int ttl)
parse(String, int)@NotNull public static @NotNull String merge(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String key, @NotNull @NotNull InputStream ins)
parse(String, InputStream, int)@NotNull public static @NotNull String merge(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String key, @NotNull @NotNull InputStream ins, int ttl)
parse(String, InputStream, int)@NotNull public static @NotNull String merge(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String key, @NotNull @NotNull String txt)
parse(String, InputStream, int)@NotNull public static @NotNull String merge(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String key, @NotNull @NotNull String txt, int ttl)
parse(String, InputStream, int)@NotNull public static @NotNull String merge(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull File file)
parse(String, InputStream, int)@NotNull public static @NotNull String merge(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull File file, int ttl)
parse(String, InputStream, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String uri)
parse(String, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String uri, int ttl)
parse(String, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String key, @NotNull @NotNull InputStream ins)
parse(String, InputStream, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String key, @NotNull @NotNull InputStream ins, int ttl)
parse(String, InputStream, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String key, String txt)
parse(String, InputStream, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull String key, @NotNull @NotNull String txt, int ttl)
parse(String, InputStream, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull File file)
parse(String, InputStream, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull File file, int ttl)
parse(String, InputStream, int)@NotNull public static @NotNull InputStream steam(@NotNull @NotNull Map<String,Object> ctx, @NotNull @NotNull Gene gene)
parse(String, InputStream, int)Copyright © 2024. All rights reserved.