I have a class that loads some files into a specific object that itself contains several objects that contain different fields. Exmaple:
class RootItem
{
public SubItemType1 sub1;
}
class SubItemType1
{
public SubItemType2 sub2;
public int data1;
public float data2;
}
class SubItemType2
{
public int data3;
public boolean data4;
}
Alright now I have another class that contains a method that will return a RootItem with all of the sub-items set to specific values.
Then I would like to, using Guice, be able to call that loader once and then whenever someone requests an @Inject of the SubItemType1 class then the RootItem.sub1 object is returned and if someone requests a SubItemType2 class then RootItem.sub1.sub2 is returned.
Can this be achived?
Thanks,
ExtremeCoder