private static void readAttributes(SInstance instance, MElement xml) { NamedNodeMap attributes = xml.getAttributes(); if (attributes != null) { for (int i = 0; i < attributes.getLength(); i++) { Attr at = (Attr) attributes.item(i); if (at.getName().equals(ID_ATTRIBUTE)) { instance.setId(Integer.valueOf(at.getValue())); } else if (!at.getName().equals(LAST_ID_ATTRIBUTE)) { InternalAccess.INTERNAL.setAttributeValueSavingForLatter(instance, at.getName(), at.getValue()); } } } }
private static void lerAtributos(SInstance instancia, MElement xml) { NamedNodeMap atributos = xml.getAttributes(); if (atributos != null) { for (int i = 0; i < atributos.getLength(); i++) { Attr at = (Attr) atributos.item(i); if (at.getName().equals(ATRIBUTO_ID)) { instancia.setId(Integer.parseInt(at.getValue())); } else if (!at.getName().equals(ATRIBUTO_LAST_ID)) { instancia.setAttributeValue(at.getName(), at.getValue()); } } } }
private static void copyIdValues(SInstance source, SInstance target) { target.setId(source.getId()); if (source instanceof SIComposite) { SIComposite sourceComposite = (SIComposite) source; SIComposite targetComposite = (SIComposite) target; for (int i = 0; i < sourceComposite.getFields().size() ; i++) { copyIdValues(sourceComposite.getField(i), targetComposite.getField(i)); } } else if (source instanceof SIList) { SIList sourceList = (SIList) source; SIList targetList = (SIList) target; if (sourceList.getChildren() != null) { for (int i = 0; i < sourceList.getChildren().size() ; i++) { SInstance sourceItem = (SInstance) sourceList.getChildren().get(i); SInstance targetItem = (SInstance) targetList.getChildren().get(i); copyIdValues(sourceItem, targetItem); } } } }
private static void copyIdValues(SInstance source, SInstance target) { target.setId(source.getId()); if (source instanceof SIComposite) { SIComposite sourceComposite = (SIComposite) source; SIComposite targetComposite = (SIComposite) target; for (int i = 0; i < sourceComposite.getFields().size() ; i++) { copyIdValues(sourceComposite.getField(i), targetComposite.getField(i)); } } else if (source instanceof SIList) { SIList sourceList = (SIList) source; SIList targetList = (SIList) target; if (sourceList.getChildren() != null) { for (int i = 0; i < sourceList.getChildren().size() ; i++) { SInstance sourceItem = (SInstance) sourceList.getChildren().get(i); SInstance targetItem = (SInstance) targetList.getChildren().get(i); copyIdValues(sourceItem, targetItem); } } } }
private static void copyIdValues(SInstance source, SInstance target) { target.setId(source.getId()); if (source instanceof SIComposite) { SIComposite sourceComposite = (SIComposite) source; SIComposite targetComposite = (SIComposite) target; for (int i = 0; i < sourceComposite.getFields().size() ; i++) { copyIdValues(sourceComposite.getField(i), targetComposite.getField(i)); } } else if (source instanceof SIList) { SIList sourceList = (SIList) source; SIList targetList = (SIList) target; if (sourceList.getChildren() != null) { for (int i = 0; i < sourceList.getChildren().size() ; i++) { SInstance sourceItem = (SInstance) sourceList.getChildren().get(i); SInstance targetItem = (SInstance) targetList.getChildren().get(i); copyIdValues(sourceItem, targetItem); } } } }
private void copyIdValues(SInstance source, SInstance target) { target.setId(source.getId()); if (source instanceof SIComposite) { SIComposite sourceComposite = (SIComposite) source; SIComposite targetComposite = (SIComposite) target; if (sourceComposite.getFields() != null) { for (int i = 0; i < sourceComposite.getFields().size() ; i++) { copyIdValues(sourceComposite.getField(i), targetComposite.getField(i)); } } } else if (source instanceof SIList) { SIList sourceList = (SIList) source; SIList targetList = (SIList) target; if (sourceList.getChildren() != null) { for (int i = 0; i < sourceList.getChildren().size() ; i++) { SInstance sourceItem = (SInstance) sourceList.getChildren().get(i); SInstance targetItem = (SInstance) targetList.getChildren().get(i); copyIdValues(sourceItem, targetItem); } } } }