declarative getter/setter via annotation

ryenus ryenus at
Wed Apr 6 15:42:21 UTC 2011

Here is a trivial one, I wonder if it's ok to request for something like
declarative getter/setter to access class fields, namely via annotations 

such as:
private boolean field1;


private int filed2;

in case there are multiple fields declared together, all fields should have
getter/setter generated, such as:
private String field3, field4;

This can reduce the noises incurred by plain getter/setter's, especially for
big classes with a lot of fields.

mark.reinhold wrote:
> It's time to start thinking about planning JDK 8.
> We already know what some of the big-ticket items are likely to be.
> There'll be room for other features too, however, both large and small.
> It's therefore time to define a simple process for collecting, sorting,
> reviewing, and prioritizing proposals and plans for new features, for
> JDK 8 and for later releases.
> Some essential requirements (not in priority order):
>   - As lightweight as possible.
>   - Simple mechanics.
>   - Version-controlled, so that changes can be tracked.
>   - Open to all committers, with transparent decision-making.
>   - The basic format should not be too different from (a simplified
>     form of) the old Sun "one-pager" template [1], with which many
>     are already familiar.
>   - An approved proposal should be able to serve as the authoritative
>     source of the summary and reference information needed for related
>     documents such as the release feature list [2] and the Platform
>     Umbrella JSR specification [3].
> One can imagine all sorts of fancy database-backed systems that would
> fulfill these requirements, but we need something sooner rather than
> later.  I think a workable solution, at least for now, is to collect
> proposals as structured text files in a Mercurial repository.  So that
> people don't have to write raw HTML or XML we could use the "Markdown"
> lightweight markup language [4] together with an existing convention
> for placing common metadata at the top of a file [5].  The Mercurial
> repository would be set up so that a push operation would automatically
> update the appropriate web pages on
> I've adapted an existing draft proposal for JDK 8 into Markdown as an
> example [6] (thanks to Maurizio Cimadamore for the draft).  The exact
> template format would, of course, be a topic of further discussion.
> Comments?
> - Mark
> [1]
> [2] E.g.,
> [3] E.g.,
> [4]
> [5]
> [6]

View this message in context:
Sent from the OpenJDK General discussion mailing list archive at

More information about the discuss mailing list