I don't really know what you want to achieve with this but it looks like you rebuild the whole typing-system.
Instead of making the type of the Data object an instance variable why don't you just create a Class DataX that extends the Data-class? Then you don't have to worry what the type your Data-object is because Java will know the dynamic type of this object and will call the appropriate methods?



