XML:namespace prefix = o ns = "urn:schemas-microsoft-com:Office:office" />
科爾沁ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!
原來這是一個(gè)判斷當(dāng)前參數(shù)的方法:
if(O02.length == 0 || O06(new String[] {
"help", "h", "?", "/?"
}))
{
System.out.println(O07.O08);
return false;
}
這一段是幫助系統(tǒng),既然我們要修改,那么先把幫助系統(tǒng)處理了.就當(dāng)咱們肯定能把這個(gè)修改成功完成.
目標(biāo)鎖定O07.O08(這是一個(gè)final static String):
public O07()
{
}
static
{
O0995 = System.getProperty("line.separator");
if(O0995 == null)
{
System.out.println("Warning:System Property line.separator not definedn");
O0995 = "rn";
}
O0997 = "Copyright (c) 2000-2003 Polygon Enterprises." + O0995 + "New Versions available from http://www.java2html.com" + O0995 + "(type j2h with no arguments to get help)";
O08 = O0995 + "Usage: [j2h|java j2h|java -jar j2h.jar][options]"
+ O0995 + "-d
+ O0995 + "-js
+ O0995 + "-jd
+ O0995 + "-m
+ O0995 + "-t
+ O0995 + "-n
+ O0995 + "-nh Prevents the header from being displayed"
+ O0995 + "-nf Prevents the footer from being displayed"
//我在這里添加了encoding的幫助信息
+ O0995 +"-encoding set the html "charset""
+O0995 + "-s Simple output, just include the Java source and stylesheet.CSS files"
+ O0995 + "-h (or no arguments) This Help" + O0995
+ O0995 + "Edit generated stylesheet.css file to change colours & styles"
+ O0995 + "View generated index.html in browser to see results after running"
+ O0995;
}
現(xiàn)在使用java2html的時(shí)候已經(jīng)有了對encoding的幫助信息了.
String as2[] = O010(new String[] {"javasource", "js"}, false, -1);
幫助信息后我們看到了類似這樣的方法調(diào)用,看來這是判斷參數(shù)內(nèi)容的方法了
private String[] O010(String as[], boolean flag, int i)
throws BadOptionException
{
int j = 0;
int k = 0;
Vector vector = new Vector();
for(; j < O02.length; j++)
{
for(int l = 0; l < as.length; l++)
{
if(!O02[j].equalsIgnoreCase("-" + as[l]))
{
continue;
}
O03[j] = true;
j++;
if(k == i)
{
throw new BadOptionException(as[0] + " should only be set " + i + " time(s)");
}
if(j >= O02.length)
{
throw new BadOptionException("Value not set for " + as[0]);
}
O03[j] = true;
vector.addElement(O02[j]);
k++;
break;
}
}
if(flag && k == 0)
{
throw new BadOptionException(as[0] + " needs to be set");
} else
{
return O026(vector);
}
}
原來這個(gè)方法是把用戶送進(jìn)來的參數(shù)(as)和java2html默認(rèn)的參數(shù)比較,如果是java2html的參數(shù)那么把用戶的參數(shù)取值.
我們先把咱們的參數(shù)添加上吧.
//添加我們自定義的參數(shù)
String as3[] = O010(new String[] {
"encoding", "encoding"
}, false, -1);
//同樣依葫蘆畫瓢
if(as3.length > 0)
{
java2html.setEncoding(as3[0]);
}
這樣用戶的參數(shù)就送進(jìn)了as[]了.
不過現(xiàn)在java2html中并沒有setEncoding方法.我們的添加一個(gè).
回到j(luò)ava2html.java中添加:
//我在這里設(shè)定了默認(rèn)的字符編碼,因?yàn)閡tf-8基本上支持所有的字符編碼.
private String encoding="UTF-8";
//添加一個(gè)新方法
public void setEncoding(String strEncoding){
encoding=strEncoding;
}
這樣,用戶的參數(shù)就已經(jīng)送到j(luò)ava2html類中了.