计算机与现代化 ›› 2014, Vol. 0 ›› Issue (1): 114-120.

• 网络与通信 • 上一篇    下一篇

基于Rhino引擎的低侵入式JavaScript内置对象扩展方法

  

  1. 华北计算技术研究所信息技术应用系统部,北京100083
  • 收稿日期:2013-08-15 出版日期:2014-01-20 发布日期:2014-02-10
  • 作者简介: 聂琨琳(1989-),男,四川蒲江人, 华北计算技术研究所信息技术应用系统部硕士研究生,研究方向:互联网信息采集,应用系统研发; 黄蔚(1972-),女,北京人,高级工程师, 硕士,研究方向:大数据处理整合与挖掘分析。

Extensions of Client-side JavaScript Built-in Objects by Low Invasion Method#br#  Based on Rhino Engine

  1. North China Institute of Computing Technology, Beijing 100083, China
  • Received:2013-08-15 Online:2014-01-20 Published:2014-02-10

摘要: 为了获取由JavaScript脚本生成的网页信息,更好地获取网页深层信息,提出基于低侵入式的Rhino解析引擎改进方法。通过对Rhino引擎解析JavaScript脚本过程进行深入研究分析,得出扩展Rhino引擎的关键环节。在此基础上提出低侵入式的设计方法,对Rhino引擎进行低耦合的扩展改进,从而完善Rhino引擎对客户端JavaScript脚本的解析。通过使用低侵入式的扩展方法,将Rhino引擎的扩展和使用完全分离,使开发人员不用了解Rhino引擎的实现细节,简化扩展开发。设计实验验证了Rhino引擎改进效果。

关键词:  , 解析, DOM树, Java扩展

Abstract: In order to obtain the pages of information generated by JavaScript scripts, better access to Web-depth information, A minimally invasion method that can improve Rhino engine is proposed. Through in-depth analysis on the process that Rhino engine parses JavaScript script, this paper draws the key to extend Rhino engine. On this basis, low-invasive design is used, Rhino engine is improved by low coupling expansion method, thereby Rhino engine parsing on the client JavaScript script is improved. Through the use of minimally invasive extension method, the expansion and use of Rhino engine are completely separated, the developers of the expansion do not have to understand the implementation details of Rhino engine, simplifying extension development. Finally, this paper verified the effect of Rhino engine improvements through experiments.

Key words:  parsing, DOM tree, Java extensions