есть структуры которых уже больше 2 десятков. помогите улучшить код. а именно какой код можно объединить в этих 2 структурах (остальные структуры похожи на эти)
class Structure_FBX_Document
private Structure_FBX_Header_Extension fbx_header_extension;
private String file_Id;
private Structure_Date creationTime;
private String creator;
private Structure_FBX_Global_Settings globalSettings;
private Structure_FBX_Documents documents;
private Structure_FBX_References references;
private Structure_FBX_Definitions definitions;
private Structure_FBX_Objects objects;
private Structure_FBX_Connections connections;
private Structure_FBX_Takes takes;
public FBX_Structure_Document(List<FBX_Node> nodes)
{
for (int i = 0; i < nodes.size(); i++)
{
FBX_Node child = nodes.get(i);
if (child.getName().equals("FBXHeaderExtension"))
fbx_header_extension = new Structure_FBX_Header_Extension(child);
else if (child.getName().equals("FileId"))
file_Id = nodes.get(i).getProperty(0).toString();
else if (child.getName().equals("CreationTime"))
creationTime = new Structure_Date(child.getProperty(0));
else if (child.getName().equals("Creator"))
creator = nodes.get(i).getProperty(0).toString();
else if (child.getName().equals("GlobalSettings"))
globalSettings = new Structure_FBX_Global_Settings(child);
else if (child.getName().equals("Documents"))
documents = new Structure_FBX_Documents(child);
else if (child.getName().equals("References"))
references = new Structure_FBX_References(child);
else if (child.getName().equals("Definitions"))
definitions = new Structure_FBX_Definitions(child);
else if (child.getName().equals("Objects"))
objects = new Structure_FBX_Objects(child);
else if (child.getName().equals("Connections"))
connections = new Structure_FBX_Connections(child);
else if (child.getName().equals("Takes"))
takes = new Structure_FBX_Takes(child);
else
{
try
{
throw new Exception("Тип не найден: " + child.getName());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}
// ниже идут геттеры
class Structure_FBX_Definitions
private int version;
private int count;
private List<Structure_Object_Type> object_typeList = new ArrayList<Structure_Object_Type>();
public Structure_FBX_Definitions(FBX_Node node)
{
super(node);
for (int i = 0; i < node.getSize_Children(); i++)
{
FBX_Node child = node.getChild(i);
if (child.getName().equals("Version")) version = Integer.parseInt(child.getProperty(0).toString());
else if (child.getName().equals("Count")) count = Integer.parseInt(child.getProperty(0).toString());
else if (child.getName().equals("ObjectType")) object_typeList.add(new Structure_Object_Type(child));
}
}
// ниже идут геттеры