xyz.erupt.tpl.service.EruptTplService Maven / Gradle / Ivy
The newest version!
package xyz.erupt.tpl.service;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.core.type.filter.TypeFilter;
import org.springframework.stereotype.Service;
import org.springframework.util.AntPathMatcher;
import org.springframework.util.Assert;
import org.springframework.util.LinkedCaseInsensitiveMap;
import org.springframework.util.PathMatcher;
import xyz.erupt.annotation.sub_erupt.Tpl;
import xyz.erupt.core.service.EruptApplication;
import xyz.erupt.core.util.EruptSpringUtil;
import xyz.erupt.tpl.annotation.EruptTpl;
import xyz.erupt.tpl.annotation.TplAction;
import xyz.erupt.tpl.engine.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Writer;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/**
* @author YuePeng
* date 2020-02-24
*/
@Order
@Service
@Slf4j
public class EruptTplService {
public static String TPL = "tpl";
private static final Map> tplEngines = new HashMap<>();
private static final Class>[] engineTemplates = {
NativeEngine.class,
FreemarkerEngine.class,
ThymeleafEngine.class,
VelocityTplEngine.class,
BeetlEngine.class,
EnjoyEngine.class
};
static {
for (Class> tpl : engineTemplates) {
try {
EngineTemplate
© 2015 - 2024 Weber Informatics LLC | Privacy Policy