【问题标题】:Does GWT 1.7 have support for Class.getSimpleName()?GWT 1.7 是否支持 Class.getSimpleName()?
【发布时间】:2009-07-15 17:09:27
【问题描述】:

GWT 1.7 是否支持Class.getSimpleName()

我目前用的是1.6,不支持这种方式。

http://code.google.com/p/google-web-toolkit/issues/detail?id=3404 表示已修复但未发布,但状态可能有一段时间没有更新。

我可以通过操作Class.getName()自己轻松复制它,但如果 GWT 1.7 支持这种方法,那么我将升级到它。

【问题讨论】:

  • GWT 2.0 似乎增加了对“Class.getSimpleName()”的支持。

标签: gwt


【解决方案1】:

幸运的是,它很容易解决。 this.getClass().getName().substring(this.getClass().getName().lastIndexOf(".")+1);

【讨论】:

  • 糟糕并不是要包含三元运算,但您明白了。
【解决方案2】:

没有。

[ERROR] Line 23: The method getSimpleName() is undefined for the type Class<capture#1-of ? extends SimpleTest>

【讨论】:

    【解决方案3】:

    根据the release notes,他们在 GWT 2.6.0 RC1 中添加了它。向下滚动到 JDK 仿真

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多