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.