if (extensions == null) {
extensions = new ArrayList<CmisExtensionElement>();
}
if (element.getValue() instanceof Map) {
extensions.add(new CmisExtensionElementImpl(null, element.getKey(), null,
convertExtension((Map<String, Object>) element.getValue())));
} else if (element.getValue() instanceof List) {
extensions.add(new CmisExtensionElementImpl(null, element.getKey(), null,
convertExtension((List<Object>) element.getValue())));
} else {
String value = (element.getValue() == null ? null : element.getValue().toString());
extensions.add(new CmisExtensionElementImpl(null, element.getKey(), null, value));
}
}
target.setExtensions(extensions);
}