2011-02-09 6 views
0

私のgwtアプリケーションでは、誰かがjava.beans.PropertyChangeSupportを使用するモジュールを開発しました。最近、私はそのモジュールを使用し始めました。私は実行時にimport java.beansを解決できません。エラー。しかし、アプリケーションはうまくいく。 gwt devモードウィンドウでコンパイラエラーが発生するのはなぜですか?何か案は?GWTのPropertyChangeSupport

00:17:33.079 [ERROR] Errors in 'file:/D:/workspace/App/src/main/java/com/abc/def/client/extract/pojos/ClientData.java' 
00:17:33.079 [ERROR] Line 3: The import java.beans cannot be resolved 
00:17:33.079 [ERROR] Line 4: The import java.beans cannot be resolved 
00:17:33.079 [ERROR] Line 11: PropertyChangeSupport cannot be resolved to a type 
00:17:33.079 [ERROR] Line 14: PropertyChangeSupport cannot be resolved to a type 
00:17:33.079 [ERROR] Line 14: PropertyChangeSupport cannot be resolved to a type 
00:17:33.079 [ERROR] Line 17: PropertyChangeListener cannot be resolved to a type 
00:17:33.079 [ERROR] Line 18: PropertyChangeSupport cannot be resolved to a type 
00:17:33.079 [ERROR] Line 21: PropertyChangeListener cannot be resolved to a type 
00:17:33.079 [ERROR] Line 22: PropertyChangeSupport cannot be resolved to a type 
00:17:33.079 [ERROR] Line 25: PropertyChangeListener cannot be resolved to a type 
00:17:33.079 [ERROR] Line 26: PropertyChangeSupport cannot be resolved to a type 
00:17:33.079 [ERROR] Line 30: PropertyChangeListener cannot be resolved to a type 
00:17:33.079 [ERROR] Line 31: PropertyChangeSupport cannot be resolved to a type 
00:17:33.079 [ERROR] Line 36: PropertyChangeListener cannot be resolved to a type 
00:17:33.079 [ERROR] Line 36: PropertyChangeSupport cannot be resolved to a type 

答えて

2

AutoBeansは、GWTの素晴らしい新機能ですが、既存のコードをリファクタリングする必要があります。アプリケーションで既にPropertyChangeSupportが使用されている場合、gwtxプロジェクトでは、java.beans.PropertyChange*クラスのGWTエミュレーションが提供されます。

2

GWTは、subset of the JRE typesを実装しています。 DevModeが動作する理由は、実行時のパフォーマンスを向上させるために、JavaソースをシステムのJREタイプとコンパイルするからです。運用モードのコンパイルを実行するときは、gwt-user.jarのファイルをcom/google/gwt/emul/java/...にします。

汎用リフレクションはデッドコードストリッピングと多くの形態のモノリシック最適化と互換性がないため、GWTコンパイラは実行時リフレクションを実装しません。 GWT Generator systemは、コンパイル時にモジュールの全タイプシステムにアクセスできるため、必要に応じて十分な静的なリフレクションを実装することができます。

「州の袋」に基づいてシステムを構築する場合は、ビジターパターンによる軽量のプロパティの反映を提供するAutoBeansフレームワークを見てください。

関連する問題