I have a class File which is being extended by two other classes CopyFile and DeleteFile.
class File {
private String filePath;
/** Setters and getters **/
}
class CopyFile {
private String destinationPath;
/**setters and getters**/
}
class DeleteFile {
}
Now I am trying to bind this to a table viewer:
ViewerSupport.bind(tableViewer, new WritableList(realm,
fileDetailsList, File.class),PojoProperties.values(File.class,
new String[] { "filePath","destinationPath"}));
I want to show destinationPath when file is an instance of CopyFile and null or "" when it is an instance of DeleteFile.
But when I am running this it is throwing an error:
Could not find property with name destinationPath in class File
Please help me out this and tell me how to implement DataBinding in case of inheritance.
Please note that when you bind
File.classthe property won't be found since it uses reflection and the property belongs toCopyFile.class. binding is done with Beans or POJOs in order to observe their details.