首页 \ 问答 \ jdk 8的Java Doclet API更改(Java Doclet API change for jdk 8)

jdk 8的Java Doclet API更改(Java Doclet API change for jdk 8)

我是Java的新手。 我试图升级到JDK 1.8,并发现在进行“gradle测试”时出现以下错误:

/u01/sv/home/sv900t1/sv_test/Test_Suites/SeleniumLibraries/src/main/java/com/csgi/svtest/selenium/CustomWriter.java:57: error: cannot find symbol
        h2("Class "+classDoc.toString());
        ^
  symbol:   method h2(String)
  location: class CustomWriter
/u01/sv/home/sv900t1/sv_test/Test_Suites/SeleniumLibraries/src/main/java/com/csgi/svtest/selenium/CustomWriter.java:58: error: cannot find symbol
        printHyperLink(classDoc.toString()+".html","","Class description<br>",true);
        ^
  symbol:   method printHyperLink(String,String,String,boolean)
  location: class CustomWriter

我提到http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java/

http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7u40-b43/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java/

(我们的代码导入:import com.sun.tools.doclets.formats.html.SubWriterHolderWriter;)

并发现许多API如h2(),printHyperLink(),hr(),table(),tableHeaderStart(),tableHeaderEnd(),tableEnd(),pre(),strong(),preEnd(),ul(), print(),li(),ulEnd(),printHtmlHeader(),center(),today(),printTop(),navLinks(),printBottom()和printBodyHtmlEnd()已被删除。

有没有一个快速的解决方法,可以让我们绕过符号错误? 或者我们应该用现有的api替换丢失的api。 这对我来说看起来像很多工作 - 成为一名进入者。 有没有关于如何做到这一点的现有例子? 我在网上搜索了很多,但找不到任何有用的东西。

CustomWriter.java中的代码用于使用自定义系统测试标签输出Javadoc页面。 任何帮助表示赞赏 - 我们时间不足。


I am a newbie to Java. I was trying to upgrade to jdk 1.8 and found the following errors on doing a "gradle test":

/u01/sv/home/sv900t1/sv_test/Test_Suites/SeleniumLibraries/src/main/java/com/csgi/svtest/selenium/CustomWriter.java:57: error: cannot find symbol
        h2("Class "+classDoc.toString());
        ^
  symbol:   method h2(String)
  location: class CustomWriter
/u01/sv/home/sv900t1/sv_test/Test_Suites/SeleniumLibraries/src/main/java/com/csgi/svtest/selenium/CustomWriter.java:58: error: cannot find symbol
        printHyperLink(classDoc.toString()+".html","","Class description<br>",true);
        ^
  symbol:   method printHyperLink(String,String,String,boolean)
  location: class CustomWriter

I referred to http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java/

and http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7u40-b43/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java/

(our code imports this: import com.sun.tools.doclets.formats.html.SubWriterHolderWriter;)

and found that many apis like h2(), printHyperLink(), hr(), table(), tableHeaderStart(), tableHeaderEnd(), tableEnd(), pre(), strong(), preEnd(), ul(), print(), li(), ulEnd(), printHtmlHeader(), center(), today(), printTop(), navLinks(), printBottom() and printBodyHtmlEnd() have been removed.

Is there a quick workaround that can enable us to bypass the symbol errors? Or should we replace the missing apis with existing ones. This looks like a lot of work to me - being an entrant. Are there any existing examples on how to do that? I have searched the internet a lot, but could not find anything useful.

The code in CustomWriter.java is for outputting a Javadoc page using custom System Test tags. Any help is appreciated - we are short on time.


原文:https://stackoverflow.com/questions/34288153
更新时间:2023-07-27 14:07

最满意答案

如果在请求中声明myHandler ,则可以使用闭包

getSomeData: function(args, myUrl, foo) {
        $.ajax( {
        type: "GET",
        url:  myUrl,
        data: args,
        async: true,
        dataType: 'json',
        success: function (data, textStatus, oHTTP){   ...   }  

         });
 },

这样, foo将在success回调中为您提供。


If you declare myHandler within the request, you can use a closure.

getSomeData: function(args, myUrl, foo) {
        $.ajax( {
        type: "GET",
        url:  myUrl,
        data: args,
        async: true,
        dataType: 'json',
        success: function (data, textStatus, oHTTP){   ...   }  

         });
 },

this way, foo will be available to you inside the success callback.

相关问答

更多
  • 使用.bind来按顺序排列。 success: function(data){ jQuery(this).removeClass('active_flag'); }.bind(this) 之后阅读.bind在这里做了什么 Use .bind to get your this in order. success: function(data){ jQuery(this).removeClass('active_flag'); }.bind(this) After that read up ...
  • 好。 这有效,但如果有人能解释它真的会爱上它! 为了防止有人需要,我把这张贴放在了这里。 for(i = 0; i < data.length; i++) fetchItem(i) fetchItem = function(i) { var query = base_url + data[i]; $.ajax({ url: query, type: 'GET', dataType: 'jsonp', timeo ...
  • 在你的JavaScript使用这个 $.ajax({ url: 'get.php', data: {'ajaxid':altCheck}, type: 'post', dataType:'json' }); 并在你的get.php中使用 $ajaxid = $_POST['ajaxid']; $sql = "SELECT * FROM table WHERE screeningId = $ajaxid"; In your javas ...
  • 您需要在发送数据时将数据串联起来。 尝试: $.ajax({ url: "/Home/SaveQBMatter", type: "POST", data: JSON.stringify({ 'Matters': result }), dataType: "json", contentType: "application/js ...
  • 这里几件事: 1)salesforce API发送的重定向响应很可能被解释为错误代码。 2)后续页面的响应代码(重定向后)是200 OK,从它的声音。 3)使用JSONP无法执行POST请求。 这是JSONP的限制; 这实际上不是一个AJAX请求,而是一个包含在动态生成的脚本标记内的HTTP GET请求。 此外,JSONP仅在请求产生200 OK的HTTP响应时才有效。 我建议使用您自己的服务器端中介来处理您的AJAX POST请求。 这将充当您的前端应用程序和salesforce API之间的代理。 这样 ...
  • 您可以使用以下脚本来获取和设置查询字符串值: