Hi,

While working on Json object serialization and deserialization by using DJN, we found that its working fine in case of both simple and complex json object. But, I have some confusions which I am going to explain by following code:

CompanyAction.java -- Our action class whose method is exposed on client side
Code:
import java.util.ArrayList;

import com.softwarementors.extjs.djn.config.annotations.DirectMethod;

public class CompanyAction {
    @DirectMethod
    public ArrayList<Company> getCompanyDetail(ArrayList<Company> companies){
        if(companies.size()>0)
            System.out.println("company name = "+companies.get(0).getName());
        
        return companies;
    }
    
    @DirectMethod
    public ArrayList<Manager> getManagerDetail(ArrayList<Manager> managers){
        if(managers.size()>0)
            System.out.println("Manager name = "+managers.get(0).getName());
        
        return managers;
    }
}
GsonBuilderConfiguratorForTesting.java --- Custom class for Json serialization and deserialization

Code:
public class GsonBuilderConfiguratorForTesting extends DefaultGsonBuilderConfigurator {

  @Override
  public void configure(GsonBuilder builder, GlobalConfiguration configuration) {
    super.configure(builder, configuration);
    
    addCustomSerializationSupport(builder);
  }

private void addCustomSerializationSupport(GsonBuilder builder) { 
    builder.registerTypeAdapter( ArrayList.class, new JsonCompanySerializer() );
    builder.registerTypeAdapter( ArrayList.class, new JsonCompanyDeserializer() );
    builder.registerTypeAdapter( ArrayList.class, new JsonManagerSerializer() );
    builder.registerTypeAdapter( ArrayList.class, new JsonManagerDeserializer() );
  }
}
Now, the scenario is that, I am calling both methods like getCompanyDetail(ArrayList<Company> companies) and getManagerDetail(ArrayList<Manager> managers) from client side and as they are taking ArrayList as a parameter, I have defined the builder.registerTypeAdapter() as shown in the code. Both the arraylist are differnt. One is of Company type and other one is of Manager type, so, obviously their will be different serialization and deserialization technique for these two.

Now the confusion is that, if getCompanyDetail(ArrayList<Company> companies) is called, how DJN controller will identify that which of these two like
builder.registerTypeAdapter( ArrayList.class, new JsonCompanyDeserializer() );
builder.registerTypeAdapter( ArrayList.class, new JsonManagerDeserializer() );
should be executed. And, if it is not possible in this case, then what may be the possible solution to solve this problem.