use of org.eclipse.emf.ecore.util.ExtendedMetaData in project kie-wb-common by kiegroup.
the class JBPMBpmn2ResourceFactoryImpl method createResource.
/**
* Creates an instance of the resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*/
@Override
public Resource createResource(URI uri) {
DroolsFactoryImpl.init();
BpsimFactoryImpl.init();
JBPMBpmn2ResourceImpl result = new JBPMBpmn2ResourceImpl(uri);
ExtendedMetaData extendedMetadata = new XmlExtendedMetadata();
result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
result.getDefaultSaveOptions().put(XMLResource.OPTION_SAVE_TYPE_INFORMATION, new OnlyContainmentTypeInfo());
result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
result.getDefaultSaveOptions().put(XMLResource.OPTION_ELEMENT_HANDLER, new ElementHandlerImpl(true));
result.getDefaultSaveOptions().put(XMLResource.OPTION_ENCODING, "UTF-8");
result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_CACHED_LOOKUP_TABLE, new ArrayList<Object>());
result.getDefaultSaveOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true);
result.getDefaultSaveOptions().put(XMLResource.OPTION_PROCESS_DANGLING_HREF, XMLResource.OPTION_PROCESS_DANGLING_HREF_RECORD);
return result;
}
use of org.eclipse.emf.ecore.util.ExtendedMetaData in project InformationSystem by ObeoNetwork.
the class XMIResourceWithMigrationSupportImpl method attachMigrationHelper.
public void attachMigrationHelper(IMigrationHelper migrationHelper) {
this.migrationHelper = migrationHelper;
ExtendedMetaData extendedMetadata = migrationHelper.getExtendedMetaData();
XMLResource.ResourceHandler resourceHandler = migrationHelper.getResourceHandler();
Map<Object, Object> loadOptions = getDefaultLoadOptions();
Map<Object, Object> saveOptions = getDefaultSaveOptions();
loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
if (extendedMetadata != null) {
saveOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
loadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
}
if (resourceHandler != null) {
saveOptions.put(XMLResource.OPTION_RESOURCE_HANDLER, resourceHandler);
loadOptions.put(XMLResource.OPTION_RESOURCE_HANDLER, resourceHandler);
}
}
Aggregations