You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.6 KiB
68 lines
1.6 KiB
package com.fanruan.api.report; |
|
|
|
import com.fr.report.stable.fun.Actor; |
|
import com.fr.stable.ActorFactory; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
/** |
|
* @author richie |
|
* @version 10.0 |
|
* Created by richie on 2019/10/12 |
|
* 预览类型工具类 |
|
*/ |
|
public class ActorKit { |
|
|
|
private ActorKit() { |
|
|
|
} |
|
|
|
/** |
|
* 获取指定类型的预览类型对象 |
|
* |
|
* @param type 指定的类型 |
|
*/ |
|
public static Actor getActor(String type) { |
|
return ActorFactory.getActor(type); |
|
} |
|
|
|
/** |
|
* 根据预览类型对象获取表示预览类型的字符串 |
|
* |
|
* @param actor 预览类型对象 |
|
* @return 表示预览类型的字符串 |
|
*/ |
|
public static String getType(Actor actor) { |
|
return ActorFactory.getType(actor); |
|
} |
|
|
|
/** |
|
* 获取指定类型的预览类型对象 |
|
* |
|
* @param type 指定的类型 |
|
* @param isMobile 是否为移动端预览 |
|
* @param isNoPage 是否为不分页预览 |
|
*/ |
|
public static Actor getActor(String type, boolean isMobile, boolean isNoPage) { |
|
return ActorFactory.getActor(type, isMobile, isNoPage); |
|
} |
|
|
|
/** |
|
* 从http请求中获取预览类型对象 |
|
* |
|
* @param req http请求 |
|
*/ |
|
public static Actor getActor(HttpServletRequest req) { |
|
return ActorFactory.getActor(req); |
|
} |
|
|
|
/** |
|
* 从http请求中获取预览类型对象 |
|
* |
|
* @param req http请求 |
|
* @param defaultActor 默认的预览类型 |
|
*/ |
|
public static Actor getActor(HttpServletRequest req, Actor defaultActor) { |
|
return ActorFactory.getActor(req, defaultActor); |
|
} |
|
}
|
|
|