Java2HTML改造手记(6) (转)

Java2HTML改造手记(6) (转)[@more@]

Java2HTML改造手记(6)

XML:namespace prefix = o ns = "urn:schemas-microsoft-com:Office:office" />

Buildjava2html方法最后调用了O01055方法,看来这个方法是最终生成html页面的方法了.

既然如此,那么我们就把这个方法中出现的所有write方法中的参数加上”.getBytes(encoding)”,而这个encoding在构造方法中已经用用户指定的编码赋值了.

修改过的是这样的:

  public void O01055()

  throws Exception

  {

  Hashtable hashtable = O01093();

  Enumeration enumeration = hashtable.keys();

  object obj = null;

  Object obj1 = null;

  while(enumeration.hasMoreElements())

  {

  String s = (String)enumeration.nextElement();

   O01090 o01090 = (O01090)hashtable.get(s);

  File file = new File(O01045);

  String s1 = file.getAbsolutePath();

  if(!s1.endsWith(File.separator))

  {

  s1 = s1 + File.separator;

  }

  String s2 = null;

  if(o01090.O01082.equals(""))

  {

  s2 = s1 + o01090.O01006 + ".java.html";

  } else

  {

  s2 = s1 + O07.O01015(o01090.O01082, File.separatorChar) + File.separatorChar + o01090.O01006 + ".java.html";

  }

  File file1 = new File(s1 + O07.O01015(o01090.O01082, '/'));

  file1.mkdirs();

  O01025 o01025 = new O01025(s2, O01040, O01041);

  FileReader filereader = new FileReader(s);

  o01025.O01032(false);

  String s3 = ".";

  if(o01090.O01082.length() == 0)

  {

  s3 = "";

  }

  O07.setEncoding(encoding);

  String s4 = O07.O01018(o01090.O01082);

 

  String s5 = O01117(s4);

 

  o01025.write(new String(O07.O01004(s5 + "stylesheet.css", o01090.O01082 + s3 + o01090.O01006).getBytes(encoding)));

 

  o01025.write(new String(O07.O01011(o01090.O01006, "", O01012).getBytes(encoding)));

  o01025.write(new String(o01025.O01037().getBytes(encoding)));

  o01025.O01032(true);

  boolean flag = false;

  try

  {

  O0106.O0108(filereader, o01025, s5, this, O01051);

  o01025.O01032(false);

  }

  catch(O0109 _ex)

  {

  flag = true;

  System.out.println("Parse Error, Non-Legal Java File. (2nd Parse - File has changed since first pars" +

"e)"

);

  }

  catch(IOException _ex)

  {

  flag = true;

  System.out.println("IO Error. (2nd Parse)");

  }

  finally

  {

  try

   {

  o01025.write(new String(O07.O01013(o01090.O01006, "", O01014).getBytes(encoding)));

  o01025.write(new String(O07.O01007().getBytes(encoding)));

  o01025.close();

  }

   catch(IOException _ex) { }

  try

  {

  filereader.close();

  }

  catch(IOException _ex) { }

  }

  if(!flag)

  {

  System.out.println("Created: " + s2);

  }

  }

  }

从这个方法中可以看出所有的资源都是从O07类中来得.

那么我们就在这个这个类中结束全部工作吧.

欲知后事如何,且听下回分解.


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-959629/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10752043/viewspace-959629/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值