package com.whatratimes.util;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
/*
-----------程序说明-------------
程序名称:JAVA写的JUBB
程序作者:Redhat
发布时间:2003.5.23
主页:http://2002.buyionline.net
授权:免费、自由传播及自由修改但请保留原作者信息
版本:1.0
使用的时候最好转换成JAVABEAN,加入你和JAVA LIB中去.
*/
public class JUBB
{
public static JUBB jubb = new JUBB();
public static String getHTML(String ubb, int question_id)
{
return jubb.getAll(ubb, question_id);
}
public static String getNoTag(String ubb )
{
String s = ubb;
s = jubb.replace(s, "&", "&");
s = jubb.replace(s, "\"", """);
s = jubb.replace(s, "<", "<");
s = jubb.replace(s, ">", ">");
return s;
}
public static String getBrText(String ubb)
{
String s = ubb;
s = jubb.replace(s, "&", "&");
s = jubb.replace(s, "\"", """);
s = jubb.replace(s, "<", "<");
s = jubb.replace(s, ">", ">");
return jubb.ReBr(s);
}
String u_s = new String("haha");
String u_s1 = new String("haha");
Pattern u_p;
Matcher u_m;
CharSequence u_s2;
boolean result;
/** 得到转换后的所有JUBB代码 */
public String getAll(String ins, int question_id)
{
String s = ins;
s = this.replace(s, "&", "&");
s = this.replace(s, "\"", """);
s = this.replace(s, "<", "<");
s = this.replace(s, ">", ">");
s = this.ReColor(s);
s = this.ReImg(s, question_id);
s = this.ReUrl(s);
// s = this.ReFly(s);
s = this.ReEmail(s);
s = this.ReBold(s);
// s = this.ReSlope(s);
// s = this.ReDownLine(s);
// s = this.ReMove(s);
s = this.ReTxtUrl(s);
s = this.ReTxtEmail(s);
s = this.ReTxtSize(s);
// s = this.ReQuote(s);
// s = this.ReCode(s);
// s = this.ReSup(s);
// s = this.ReSub(s);
// s = this.ReDelLine(s);
// s = this.ReFliph(s);
// s = this.ReFlipv(s);
// s = this.ReShadow(s);
// s = this.ReGlow(s);
// s = this.ReBlur(s);
// s = this.ReSwf(s);
// s = this.ReRm(s);
// s = this.ReMp(s);
// s = this.ReSk(s);
// s = this.ReSound(s);
// s = this.ReInvert(s);
// s = this.ReXray(s);
// s = this.ReLi(s);
// s = this.ReLi1(s);
// s = this.ReLi2(s);
s = this.ReBr(s);
s = this.ReAlign(s);
// s = this.ReQt(s);
s = this.ReFace(s);
s = this.ReSpace(s);
return s;
}
/** 每个替换都需要用到的公共函数 */
public String replace(String strSource, String strFrom, String strTo)
{
String strDest = "";
int intFromLen = strFrom.length();
int intPos;
while ((intPos = strSource.indexOf(strFrom)) != -1)
{
strDest = strDest + strSource.substring(0, intPos);
strDest = strDest + strTo;
strSource = strSource.substring(intPos + intFromLen);
}
strDest = strDest + strSource;
return strDest;
}
//
// <font color="#FF0000">hhhhhh</font>
/** 转换URL([url=http://www.sina.com.cn]新浪[/url]) */
/** Color替换([color=#dbff00]aaaa[/color]) */
public String ReColor(String ins)
{
this.u_s1 = ins;
this.u_s = ins;
this.u_s2 = this.u_s1.subSequence(0, this.u_s1.length());
try
{
this.u_p = Pattern.compile("(\\[color=)([^\\]]+)(\\])(.+?)(\\[\\/color\\])", Pattern.CASE_INSENSITIVE);
this.u_m = this.u_p.matcher(this.u_s2);
this.result = this.u_m.find();
while (result)
{
this.u_s = this.replace(this.u_s1, this.u_m.group(1) + this.u_m.group(2) + this.u_m.group(3) + this.u_m.group(4) + this.u_m.group(5), "<font color='" + this.u_m.group(2) + "'>" + this.u_m.group(4) + "</font>");
this.u_s1 = this.u_s;
this.u_m.find();
}
} catch (Exception e)
{
}
return u_s;
}
/** IMG替换([img]http://domain.com/path/img.jpg[/img]) */
public String ReImg(String ins, int question_id)
{
this.u_s1 = ins;
this.u_s = ins;
this.u_s2 = this.u_s1.subSequence(0, this.u_s1.length());
try
{
this.u_p = Pattern.compile("(\\[img\\])(.+?)(\\[\\/img\\])", Pattern.CASE_INSENSITIVE);
this.u_m = this.u_p.matcher(this.u_s2);
this.result = this.u_m.find();
while (result)
{
this.u_s = this.replace(this.u_s1, this.u_m.group(1) + this.u_m.group(2) + this.u_m.group(3), "<img src=../CourseQuestion/"+ question_id +"/" + this.u_m.group(2) + " border=0>");
this.u_s1 = this.u_s;
this.u_m.find();
}
} catch (Exception e)
{
}
return u_s;
}
/** 图片底片效果([invert]img.jpg[/invert]) */
public String ReInvert(String ins)
{
this.u_s1 = ins;
this.u_s = ins;
this.u_s2 = this.u_s1.subSequence(0, this.u_s1.length());
try
{
this.u_p = Pattern.compile("(\\[invert\\])(.+?)(\\[\\/invert\\])", Pattern.CASE_INSENSITIVE);
this.u_m = this.u_p.matcher(this.u_s2);
this.result = this.u_m.find();
while (result)
{
this.u_s = this.replace(this.u_s1, this.u_m.group(1) + this.u_m.group(2) + this.u_m.group(3), "<table style=\"filter:invert\"><img src=" + this.u_m.group(2) + " border=0></table>");
this.u_s1 = this.u_s;
this.u_m.find();
}
} catch (Exception e)
{
}
return u_s;
}
/** 图片曝光效果([xray]img.jpg[/xray]) */
public String ReXray(String ins)
{
this.u_s1 = ins;
this.u_s = ins;
this.u_s2 = this.u_s1.subSequence(0, this.u_s1.length());
try
{
this.u_p = Pattern.compile("(\\[xray\\])(.+?)(\\[\\/xray\\])", Pattern.CASE_INSENSITIVE);
this.u_m = this.u_p.matcher(this.u_s2);
this.result = this.u_m.find();
while (result)
{
this.u_s = this.replace(this.u_s1, this.u_m.group(1) + this.u_m.group(2) + this.u_m.group(3), "<table style=\"filter:xray\"><img src=" + this.u_m.group(2) + " border=0></table>");
this.u_s1 = this.u_s;
this.u_m.find();
}
} catch (Exception e)
{
}
return u_s;
}
/** 转换URL([url]http://somedomain[/url]) */
public String ReUrl(String ins)
{
this.u_s1 = ins;
this.u_s = ins;
this.u_s2 = this.u_s1.subSequence(0, this.u_s1.length());
try
{
this.u_p = Pattern.compile("(\\[url\\])(.+?)(\\[\\/url\\])", Pattern.CASE_INSENSITIVE);
this.u_m = this.u_p.matcher(this.u_s2);
this.result = this.u_m.find();
while (result)
{
this.u_s = this.replace(this.u_s1, this.u_m.group(1) + this.u_m.group(2) + this.u_m.group(3), "<a href=" + this.u_m.group(2) + " target=_blank>" + this.u_m.group(2) + "</a>");
this.u_s1 = this.u_s;
this.u_m.find();
}
} catch (Exception e)
{
}
return u_s;
}
/** 转换URL([url=http://www.sina.com.cn]新浪[/url]) */
public String ReTxtUrl(String ins)
{
this.u_s1 = ins;
this.u_s = ins;
this.u_s2 = this.u_s1.subSequence(0, this.u_s1.length());
没有合适的资源?快使用搜索试试~ 我知道了~
本文档是为了说明在进行概要设计时,WebEDU项目说涉及类设计,它能够明确在项目中采用面向对象技术时需要生产的对象和类,并且通过各类对象、类之间的关系能够明确系统的实现结构。在阅读本文档之前,请确认您已经详细的阅读过《WebEDU项目软件需求规格说明》,并且理解里面的内容。
当我们拥有了一份准确清晰的软件需求规格说明后,我们需要根据需求规格说明中的用例及功能进行设计,在面向对象的设计中,所需要完成的工作就是根据用例模型和功能模型进行对象和逻辑类的设计。本文档所记录的就是根据《WebEDU项目软件需求规格说明》所进行的对象和逻辑类设计的成果。
在本文档中,共涉及了WebEDU项目的六个功能块,包含:
论坛管理:所对应的包为BbsManage
消息管理: 所对应的包为MessageManage
用户管理: 所对应的包为StudentManage
教员管理: 所对应的包为TeacherManage
学员管理: 所对应的包为UserManage
课程学习及考试: 所对应的包为StudentStudy
具体各功能块中所涉及的逻辑类,逻辑类之间的关系和类中各类接口的说明请查阅一下的文档
收起资源包目录





































































































共 541 条
- 1
- 2
- 3
- 4
- 5
- 6
资源推荐
资源预览
资源评论
2023-03-13 上传
152 浏览量
176 浏览量

2023-06-29 上传
2024-04-11 上传
101 浏览量
2024-03-22 上传
200 浏览量

175 浏览量
2023-06-16 上传
2020-07-16 上传
191 浏览量
2024-04-11 上传
2024-03-28 上传
143 浏览量
140 浏览量


102 浏览量
197 浏览量
185 浏览量
2024-04-07 上传
2024-04-11 上传
资源评论


程序猿小乙
- 粉丝: 64
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 从芯片到整机-5G CPE终端组成原理大揭秘(附主流工业5G CPE性能评测对比)
- 艾索特AH4电脑调音软件下载
- VB编程中全局变量的定义与使用示例
- f3ed066e7i6e24f0fe23eb23e15b3f78.apk
- arm linux tool chain gcc g++
- Vue组件中利用is属性实现动态渲染组件操作
- ADDZEST歌乐APS8100BT电脑调音软件下载
- Android设备电源状态监测:电量、温度与电压实时获取实例代码
- “将Base64编码转换为图片并保存至本地”
- 6合1单芯片SOC智能锁方案源代码
- 基于java编写的俄罗斯方块游戏.zip
- 基于java编写的拉火车游戏.zip
- QT5实现简易FTP服务器交互功能
- 珍珠鸟丽音匣P4.1电脑版
- 基于java编写的铺鱼达人游戏.zip
- 基于java编写的贪吃蛇游戏.zip
安全验证
文档复制为VIP权益,开通VIP直接复制
