public abstract class IGeneralParser
extends com.mingsoft.parser.IParser
铭飞科技
Copyright: Copyright (c) 2014 - 2015
Comments: ms平台通用标签解析
Create Date:2015-4-19
Modification history:
| 限定符和类型 | 字段和说明 |
|---|---|
protected AppEntity |
app |
static String |
CUR_COLUMNID |
static String |
CUR_PAGE_NO |
protected String |
htmlContent |
static String |
LIST_LINK_PATH |
protected Map |
map |
static Object |
MOBILE
移动端生成路径
|
protected String |
mobilePath |
static String |
MODEL_ID |
protected int |
modelId
模块编号
|
protected String |
modelPath
模块模板路径,例如论坛、商城等
|
static String |
NEXT |
protected com.mingsoft.util.PageUtil |
page |
static String |
PREVIOUS |
static String |
REQUEST_PARAM |
| 构造器和说明 |
|---|
IGeneralParser() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
getWebsiteUrl()
会根据用户的请求客户端返回pc页面\手机页面主机地址
|
void |
init(Object... obj)
解析器入口,通常第一个参数未appEntity,如果存在map类型,那么map的的键值为IGeneralParser常量
1、内容数据显示、列表数据、 a、cms 下的文章显示,当前文章的上一篇、下一篇、当前文章栏目 MsTagParser mtp = new
MsTagParser(模块代码,ServletConext); Map map = new HashMap();
map.put(CmsParser.PREVIOUS,preArticle);
map.put(CmsParser.NEXT,preArticle); mtp.parse(app,article,);
b、cms列表,必须知道当前栏目信息 mtp.parse(app,article,column); 2、自动定义页面
|
String |
parse() |
abstract String |
parse(String html,
Object... obj)
解析方法模板,最后调用该方法返回生成后的数据
|
protected String |
parseGeneral()
通用的标签解析方法,其他扩展方法务必要调用该方法,否则导致模板页面取不出基本数据,如:网站名称,网站的地址,关键字等待
|
protected String |
parseGeneral(String modelPath)
生成通用标签,
|
public static final Object MOBILE
protected AppEntity app
protected String mobilePath
protected String htmlContent
protected com.mingsoft.util.PageUtil page
protected String modelPath
protected Map map
protected int modelId
protected String parseGeneral()
protected String parseGeneral(String modelPath)
modelPath - 对用模块模板路径protected String getWebsiteUrl()
public abstract String parse(String html, Object... obj)
html - 模板源代码obj - 可选:便于子模块调用的时候进行参数扩展,具体的参数由子模块控制,例如解析分页模板的时候就需要外部传入地址,public String parse()
parse 在类中 com.mingsoft.parser.IParserpublic void init(Object... obj)
obj - ,可以存在多个,对于基础数据类型可以使用map存储,对象直接传入Copyright © 2018. All rights reserved.