Java2HTML改造手記(5) (轉)
2HTML改造手記(5)
:namespace prefix = o ns = "urn:schemas--com::office" />
接下來就是我們的重頭戲了.讓這個引數起作用.
在java2html.java main方法中最後了
java2html.buildJava2HTML();
那麼我們就從這裡繼續吧.
public boolean buildJava2HTML()
throws Exception
{
O01049();
O01050 o01050 = new O01050(O01044);
if(O01043 == null)
{
setJavaDirectory(new String[] {
"."
});
}
O01052 o01052 = new O01052(O01043, O01045, O01040, O01041, O01012, O01014, o01050);
if(!O01042)
{
O01052.O01054(O01045, o01052, O01002);
}
o01052.O01055();
return true;
}
先看看O01049()作了什麼:
private void O01049()
throws IOException
{
(new File(O01045)).mkdirs();
File file = null;
FileWriter filewriter = null;
file = new File(O01045 + File.separator + "stylesheet.css");
filewriter = new FileWriter(file);
filewriter.write(O07.O0998());
filewriter.close();
System.out.println("Created " + file.getAbsolutePath());
if(!O01042)
{
File file1 = new File(O01045 + File.separator + "front.html");
FileWriter filewriter1 = new FileWriter(file1);
filewriter1.write(O07.O0999());
filewriter1.close();
System.out.println("Created " + file1.getAbsolutePath());
file1 = new File(O01045 + File.separator + "index.html");
filewriter1 = new FileWriter(file1);
filewriter1.write(O07.O01001(O01002));
filewriter1.close();
}
}
原來這裡生成了幾個基本的頁面和樣式表.而所需的資源是從O07中讀取出來的,看來這個是重點了.不過這個方法也要修改一下,在輸出html檔案的時候應該使用指定的屬性,既然資源是從O07出來的,那麼給O07也新增一個encoding屬性吧.
//O07.java
static String s2;
public static void setEncoding(String str){
s2=str;
}
//java2html.java
private void O01049()
throws IOException
{
(new File(O01045)).mkdirs();
File file = null;
FileWriter filewriter = null;
file = new File(O01045 + File.separator + "stylesheet.css");
filewriter = new FileWriter(file);
//modify
filewriter.write(new String(O07.O0998().getBytes(encoding)));
filewriter.close();
System.out.println("Created " + file.getAbsolutePath());
if(!O01042)
{
//寫了front.html檔案,資源是從O07讀取的.原來O07是一個資原始檔
//那麼我們也給O07新增一個Encoding屬性吧.
O07.setEncoding(encoding);
File file1 = new File(O01045 + File.separator + "front.html");
FileWriter filewriter1 = new FileWriter(file1);
//編碼處理
filewriter1.write(new String(O07.O0999().getBytes(encoding)));
filewriter1.close();
System.out.println("Created " + file1.getAbsolutePath());
file1 = new File(O01045 + File.separator + "index.html");
filewriter1 = new FileWriter(file1);
//編碼處理
filewriter1.write(new String((O07.O01001(O01002)).getBytes(encoding)));
filewriter1.close();
}
}
讓我們回到buildjava2html方法中,看到:
O01052 o01052 = new O01052(O01043, O01045, O01040, O01041, O01012, O01014, o01050);
原來使用者引數都是在這裡傳送進去的,那麼把我們的引數也送進取吧.
O01052 o01052 = new O01052(O01043, O01045, O01040, O01041, O01012, O01014, o01050,encoding);
然後在O01052中新增:
private static String encoding;
並把它的構造修改一下:
public O01052(String as[], String s, int i, int j, boolean flag, boolean flag1, O01050 o01050,String s1)
{
O0106 = new O040(System.in);
for(int k = 0; k < as.length; k++)
{
O01097(as[k]);
}
O01045 = s;
O01040 = i;
O01041 = j;
O01012 = flag;
O01014 = flag1;
O01051 = o01050;
encoding=s1;
}
欲知後事如何,且聽下回分解.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752019/viewspace-983739/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Java2HTML改造手記(7) (轉)JavaHTML
- Java2HTML改造手記(6) (轉)JavaHTML
- Java2HTML改造手記(續) (轉)JavaHTML
- Java2HTML改造手記(1) (轉)JavaHTML
- Java2HTML改造手記(2) (轉)JavaHTML
- Java2HTML改造手記(4) (轉)JavaHTML
- Java2HTML改造手記(3) (轉)JavaHTML
- Windows快速啟動欄拓寬改造記(轉)Windows
- 安裝RedHat7.3並改造的記錄(轉)Redhat
- PHP 5 Dockerfile 改造過程PHPDocker
- Knockout.js隨手記(5)JS
- sqlrelay 安裝手記(轉)SQL
- MySpy開發手記 (轉)
- DirectX學習手記(-) (轉)
- DirectX學習手記(二) (轉)
- FC6安裝手記(轉)
- GoodNotes 5 for mac(手寫筆記軟體)GoMac筆記
- SED 手冊 - 5.常用的 regular expression(轉)Express
- Slackware 10.0 安裝手記(轉)
- Fedora Core 4 Release 安裝手記(轉)
- React學習手記5-細說元件stateReact元件
- GoodNotes 5:Mac上的手寫筆記神器GoMac筆記
- moquette改造筆記(一):整合到SpringBoot筆記Spring Boot
- RayLx 1.5 硬碟安裝手記(從FAT)(轉)硬碟
- ESMTP身份驗證機制探索手記 (轉)
- Servlet/JSP 容器開發手記2 (轉)ServletJS
- MySQL中文參考手冊5(安裝MySQL下) (轉)MySql
- Vue.js SSR Step by Step (3) - 改造 vue/webpack 腳手架Vue.jsWeb
- <轉>oracle效能調整讀書筆記(5)Oracle筆記
- IPv6改造方案:協議轉換技術協議
- Presto改造REST
- spritecow改造
- Gentoo 1.4RC_2光碟安裝手記(轉)
- Linux 管理員手冊(5)--引導和關機(轉)Linux
- 舊專案 TypeScript 改造問題與解決方案記TypeScript
- XML初學進階學習筆記(5)(轉)XML筆記
- 寒假專案1-動態連結串列體驗(改造)(5)
- Android徹底元件化—UI跳轉升級改造Android元件化UI