GWTでlombokを使用する
- eclipseにlombokをインストール
- (lombokを使用してjavaファイルを作成)
- GWT Compile Project -> Advanced -> VM arguments: に次の文を追加
- javaagent:lib/lombok.jar=ECJ (プロジェクトのlibフォルダにlombok.jarを入れているとき)
「(ゲッター名)is undefined for the type」のようなエラーが出たとき
対象のフィールドにいったん @Getterをつけてから再コンパイルすると直ることがある。
参考:
Project Lombok
@Data @Model(schemaVersion = 1) public class MyModel implements Serializable { private static final long serialVersionUID = 1L; @Attribute(primaryKey = true) private Key key; @Attribute(version = true) private Long version; // @Getter private String title; @Attribute(unindexed=true) private String content; @Attribute(lob=true) private String description; }