How to declare more than one column name using Xcelite library

Eduardo Eljaiek :

I'm deserializing a Java bean from an Excel spreadsheets using Xcelite, and I've an attribute within it which can match more than one column name in different spreadsheets.

This is my Java Bean

import com.ebay.xcelite.annotations.Column;

public class User {

   @Column(name = "User") 
   private String username;

   @Column(name = "Email") 
   private String email;    
}

I must deserialize the same object using another spreadsheet which instead of use User column name it use Login.

I could use the solution below, but I'd like to know if is there a better one ?

public class User {

   @Column(name = "User") 
   private String username;

   @Column(name = "Login") 
   private String login;

   @Column(name = "Email") 
   private String email;   

   public String getUsername() {
      return username != null ? username : login;  
   }
}
Johannes Jander :

Unfortunately, there are currently no provisions for that.

Xcelite is focused on reading from one sheet at a time, and knows nothing about applying a mapping to multiple sheets.

As you may have noticed, the original Xcelite code has been abandoned by Ebay. I maintain a fork, you are more than welcome to help out by speccing a mapping over multiple sheets. I can see the merit of what you are trying to do.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=164638&siteId=1