Node startTimeNode = d1.getAttributes().getNamedItem("sale_start_date");
long startTimeSale = startTimeNode != null ? getMillisecondsFromString(startTimeNode.getNodeValue()) : 0;
Node endTimeNode = d1.getAttributes().getNamedItem("sale_end_date");
long endTimeSale = endTimeNode != null ? getMillisecondsFromString(endTimeNode.getNodeValue()) : 0;
ArrayList<ProductItemComponent> components = new ArrayList<>();
ProductItem pr = new ProductItem(productId, category, price, tabId, startTimeSale, endTimeSale);
for (Node t1 = d1.getFirstChild(); t1 != null; t1 = t1.getNextSibling())
{
if ("component".equalsIgnoreCase(t1.getNodeName()))
{
int item_id = Integer.parseInt(t1.getAttributes().getNamedItem("item_id").getNodeValue());
int count = Integer.parseInt(t1.getAttributes().getNamedItem("count").getNodeValue());
ProductItemComponent component = new ProductItemComponent(item_id, count);
components.add(component);
}
}
pr.setComponents(components);
_itemsList.put(productId, pr);
}
}
}
}