Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7831977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:58:16+00:00 2026-06-02T11:58:16+00:00

In playframework , it uses javassist library to let the public fields of a

  • 0

In playframework, it uses javassist library to let the public fields of a class can be used as property.

See the example:

public class User {
    public String name;
}

User user = new User();
user.name = "Freewind"
System.out.println(user.name);

In compilation time, play enhanced the bytecode with javassist, the final code is similar to:

public class User {
    private String name;
    public String getName() { return this.name; };
    public void setName() { this.name = name; };
}

User user = new User();
user.setName("Freewind");
System.out.println(user.getName());

You can see not only the field name has getter and setter, but also the invocations of it changed to getters and setters.

I wonder if there is any other way to do the same (use other things than javassist)?

I found Annotation Processing Tool, but I’m not sure it can do it.

Or aspectj? Or something else?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:58:18+00:00Added an answer on June 2, 2026 at 11:58 am

    You can look at Project Lombok, which does something similar, but with annotations. With project lombok you do need to use the getters and setters in your own code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a playframework Job class like this: public class ImageDownloader extends Job {
I have the following model (playframework): @Entity public class Album extends Model{ public Album(){
I am using the asynchronous I/O library of the playframework which uses Iteratees and
Twitter bootstrap uses <table class=table> for table formatting. Playframework CRUD uses <table> for formatting
In playframework 1.x there used to be some bundled java extensions for the templating
I'm looking at the example at https://github.com/playframework/Play20/tree/master/samples/scala/websocket-chat To make a websocket controller, you write
I've got very strange behaviour when I run playframework in scala. I used anorm
IDE: netbeans Playframework: v 1.2.4 from my app/controllers/application.java i call following public static void
I have a problem with PlayFramework 1.2.5 and my question is: How can I
I am kind of new to PlayFramework 2 and can not figure out how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.