Sebastian
Sebastian

Reputation: 6057

Is there a way to auto-generate AutoBean interfaces

I just stumbled upon the GWT com.google.web.bindery.autobean.shared.AutoBean and learned that I have to write and maintain AutoBean Interfaces for my classes if I want to create AutoBeans from them.

This looks like a lot of boilerplate code for me. Is there a way to create those AutoBeans by code generation or something?

To clarify what I want to do:

I have existing classes like:

public class Person {

  private String name;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

}

In the end I want to use AutoBeanUtils.getAllProperties() so the AutoBean needs to have all properties of the original class.

But to use AutoBeans I have to define interfaces like

public interface PersonAutoBeanDefinition {  
  String getName();  
}

Of course this works but I wondered if I could generate these interfaces via Annotations or something because maintaining bigger objects where different developers work on sounds like a pain.

Upvotes: 1

Views: 62

Answers (0)

Related Questions