google / google/auto

Support annotations in generated field

Open
#280 10 comments 0 reactions 1 assignee Claimed by @eamonnmcmanus View on GitHub
Component: value P3
Dominant language
Java
Stars
10.6k
Forks
1.2k
Avg merge
6h 32m
Merged PRs (30d)
13

Description

Let's say I have a class ExcelDto:

``` java
import com.google.auto.value.AutoValue;
import javax.xml.bind.annotation.*;
import java.util.List;

@XmlRootElement(name = "excel")
@XmlAccessorType(XmlAccessType.FIELD)
@AutoValue
public abstract class ExcelDto {

@XmlElementWrapper(name = "tables")
@XmlElement(name = "table")
public abstract List getTables();

public static ExcelDto create(List tables) {
return new AutoValue_ExcelDto(tables);
}
}
```

Now I wanted the generator to build an `AutoValue_ExcelDto` class, but with the field `tables` annotated like:

...

``` java
@javax.xml.bind.annotation.XmlTransient
private final List tables;
```

...

Is that possible, how to achieve this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.