public static boolean writeExtensionElements(BaseElement baseElement, boolean didWriteExtensionStartElement, Map<String, String> namespaceMap, XMLStreamWriter xtw) throws Exception { if (!baseElement.getExtensionElements().isEmpty()) { if (!didWriteExtensionStartElement) { xtw.writeStartElement(ELEMENT_EXTENSIONS); didWriteExtensionStartElement = true; } if (namespaceMap == null) { namespaceMap = new HashMap<>(); } for (List<ExtensionElement> extensionElements : baseElement.getExtensionElements().values()) { for (ExtensionElement extensionElement : extensionElements) { writeExtensionElement(extensionElement, namespaceMap, xtw); } } } return didWriteExtensionStartElement; }
public void setValues(BaseElement otherElement) { setId(otherElement.getId()); extensionElements = new LinkedHashMap<>(); if (otherElement.getExtensionElements() != null && !otherElement.getExtensionElements().isEmpty()) { for (String key : otherElement.getExtensionElements().keySet()) { List<ExtensionElement> otherElementList = otherElement.getExtensionElements().get(key); if (otherElementList != null && !otherElementList.isEmpty()) { List<ExtensionElement> elementList = new ArrayList<>(); for (ExtensionElement extensionElement : otherElementList) { elementList.add(extensionElement.clone()); } extensionElements.put(key, elementList); } } } attributes = new LinkedHashMap<>(); if (otherElement.getAttributes() != null && !otherElement.getAttributes().isEmpty()) { for (String key : otherElement.getAttributes().keySet()) { List<ExtensionAttribute> otherAttributeList = otherElement.getAttributes().get(key); if (otherAttributeList != null && !otherAttributeList.isEmpty()) { List<ExtensionAttribute> attributeList = new ArrayList<>(); for (ExtensionAttribute extensionAttribute : otherAttributeList) { attributeList.add(extensionAttribute.clone()); } attributes.put(key, attributeList); } } } }
public void setValues(BaseElement otherElement) { setId(otherElement.getId()); extensionElements = new LinkedHashMap<>(); if (otherElement.getExtensionElements() != null && !otherElement.getExtensionElements().isEmpty()) { for (String key : otherElement.getExtensionElements().keySet()) { List<ExtensionElement> otherElementList = otherElement.getExtensionElements().get(key); if (otherElementList != null && !otherElementList.isEmpty()) { List<ExtensionElement> elementList = new ArrayList<>(); for (ExtensionElement extensionElement : otherElementList) { elementList.add(extensionElement.clone()); } extensionElements.put(key, elementList); } } } attributes = new LinkedHashMap<>(); if (otherElement.getAttributes() != null && !otherElement.getAttributes().isEmpty()) { for (String key : otherElement.getAttributes().keySet()) { List<ExtensionAttribute> otherAttributeList = otherElement.getAttributes().get(key); if (otherAttributeList != null && !otherAttributeList.isEmpty()) { List<ExtensionAttribute> attributeList = new ArrayList<>(); for (ExtensionAttribute extensionAttribute : otherAttributeList) { attributeList.add(extensionAttribute.clone()); } attributes.put(key, attributeList); } } } }