mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-11 03:13:38 +00:00
ecj: Jacksonized for accessors
This commit is contained in:
1 parent
70dd3f0940
commit
5c2ddc8ddb
3 files changed
+13
-2
No files matched your search
@@ -177,6 +177,7 @@ public class HandleJacksonized extends EclipseAnnotationHandler<Jacksonized> {
|
||||
createJsonPropertyForField(eclipseNode, annotationNode);
|
||||
}
|
||||
}
|
||||
tdNode.rebuild();
|
||||
}
|
||||
|
||||
private void createJsonPropertyForField(EclipseNode fieldNode, EclipseNode annotationNode) {
|
||||
|
||||
@@ -27,6 +27,7 @@ import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -59,6 +60,8 @@ import org.eclipse.jdt.internal.compiler.ast.TypeReference;
|
||||
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
|
||||
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
* Handles the {@code lombok.Setter} annotation for eclipse.
|
||||
*/
|
||||
@@ -109,6 +112,13 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
|
||||
//The annotation will make it happen, so we can skip it.
|
||||
return;
|
||||
}
|
||||
|
||||
// If a fluent setter should be generated, force-copy annotations from the field.
|
||||
AnnotationValues<Accessors> accessorsForField = EclipseHandlerUtil.getAccessorsForField(fieldNode);
|
||||
Annotation[] copyableToSetterAnnotations = findCopyableToSetterAnnotations(fieldNode, accessorsForField.isExplicit("fluent"));
|
||||
onMethod = Lists.newArrayList(onMethod);
|
||||
onMethod.addAll(Arrays.asList(copyableToSetterAnnotations));
|
||||
|
||||
createSetterForField(level, fieldNode, sourceNode, false, onMethod, onParam);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ public @lombok.extern.jackson.Jacksonized @lombok.experimental.Accessors(fluent
|
||||
public JacksonizedAccessors() {
|
||||
super();
|
||||
}
|
||||
public @java.lang.SuppressWarnings("all") @lombok.Generated @com.fasterxml.jackson.annotation.JsonProperty("intValue") int intValue() {
|
||||
public @com.fasterxml.jackson.annotation.JsonProperty("intValue") @java.lang.SuppressWarnings("all") @lombok.Generated int intValue() {
|
||||
return this.intValue;
|
||||
}
|
||||
/**
|
||||
* @return {@code this}.
|
||||
*/
|
||||
public @java.lang.SuppressWarnings("all") @lombok.Generated @com.fasterxml.jackson.annotation.JsonProperty("intValue") JacksonizedAccessors intValue(final int intValue) {
|
||||
public @com.fasterxml.jackson.annotation.JsonProperty("intValue") @java.lang.SuppressWarnings("all") @lombok.Generated JacksonizedAccessors intValue(final int intValue) {
|
||||
this.intValue = intValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user