-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3517 added handler and test, nothing compiles ?
- Loading branch information
glelouet
committed
Oct 6, 2023
1 parent
82dd428
commit 7571e41
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package lombok.eclipse.handlers; | ||
|
||
import lombok.Onstruct; | ||
import lombok.core.AnnotationValues; | ||
import lombok.core.HandlerPriority; | ||
import lombok.eclipse.EclipseAnnotationHandler; | ||
import lombok.eclipse.EclipseNode; | ||
|
||
@HandlerPriority(65536) // same as HandleValue // TODO | ||
public class HandleOnstruct extends EclipseAnnotationHandler<Onstruct> { | ||
|
||
public static final HandleOnstruct INSTANCE = new HandleOnstruct(); | ||
|
||
@Override | ||
public void handle(AnnotationValues<Onstruct> annotation, Annotation ast, EclipseNode annotationNode) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import java.util.Date; | ||
import java.util.Objects; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Onstruct; | ||
import lombok.experimental.Accessors; | ||
|
||
public class OnstructBook { | ||
|
||
@lombok.Getter | ||
@AllArgsConstructor | ||
public static class Book { | ||
|
||
private String author; | ||
@Accessors(fluent = true) | ||
private String name; | ||
private Date editionDate; | ||
private boolean purchasable; | ||
|
||
} | ||
|
||
void test() { | ||
Book mybook = new Book("author0", "bookname0", new Date(), true); | ||
@Onstruct(prefix = "b_") | ||
Object author, name, editiondate, purchasable = mybook; | ||
assert Objects.equals(mybook.getAuthor(), author); | ||
assert Objects.equals(mybook.name(), name); | ||
assert Objects.equals(mybook.getEditionDate(), editiondate); | ||
assert Objects.equals(mybook.isPurchasable(), purchasable); | ||
} | ||
|
||
} |