private void aggregate(String productName, MetadataElement processingGraphElement) { final MetadataElement inputMetaElement = Utilities.createSourceMetaElement(productName, aggregatedCount); if (processingGraphElement != null && aggregatedCount == 0) { inputMetaElement.addElement(processingGraphElement.createDeepClone()); } inputsMetaElement.addElementAt(inputMetaElement, aggregatedCount); ++aggregatedCount; } }
private void aggregate(String productName, MetadataElement processingGraphElement) { final MetadataElement productElement = Utilities.createSourceMetaElement(productName, aggregatedCount); if (processingGraphElement != null) { productElement.addElement(processingGraphElement.createDeepClone()); } inputsMetaElement.addElementAt(productElement, aggregatedCount); ++aggregatedCount; } }
/** * Copies all metadata elements and attributes of the source element to the target element. * The copied elements and attributes are deeply cloned. * * @param source the source element. * @param target the target element. * * @throws NullPointerException if the source or the target element is {@code null}. */ public static void copyMetadata(MetadataElement source, MetadataElement target) { Assert.notNull(source, "source"); Assert.notNull(target, "target"); for (final MetadataElement element : source.getElements()) { target.addElement(element.createDeepClone()); } for (final MetadataAttribute attribute : source.getAttributes()) { target.addAttribute(attribute.createDeepClone()); } }
public MetadataElement createDeepClone() { MetadataElement clone = new MetadataElement(getName()); clone.setDescription(getDescription()); MetadataAttribute[] attributes = getAttributes(); for (MetadataAttribute attribute : attributes) { clone.addAttribute(attribute.createDeepClone()); } MetadataElement[] elements = getElements(); for (MetadataElement element : elements) { clone.addElement(element.createDeepClone()); } return clone; }