Search in sources :

Example 26 with ExtendedMetaData

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;
}
Also used : XmlExtendedMetadata(org.eclipse.bpmn2.util.XmlExtendedMetadata) ElementHandlerImpl(org.eclipse.emf.ecore.xmi.impl.ElementHandlerImpl) OnlyContainmentTypeInfo(org.eclipse.bpmn2.util.OnlyContainmentTypeInfo) ExtendedMetaData(org.eclipse.emf.ecore.util.ExtendedMetaData)

Example 27 with ExtendedMetaData

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);
    }
}
Also used : EObject(org.eclipse.emf.ecore.EObject) ExtendedMetaData(org.eclipse.emf.ecore.util.ExtendedMetaData) XMLResource(org.eclipse.emf.ecore.xmi.XMLResource)

Aggregations

ExtendedMetaData (org.eclipse.emf.ecore.util.ExtendedMetaData)27 EAttributeImpl (org.eclipse.emf.ecore.impl.EAttributeImpl)24 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)24 ArrayList (java.util.ArrayList)10 EObject (org.eclipse.emf.ecore.EObject)9 Parameter (bpsim.Parameter)6 FloatingParameterType (bpsim.FloatingParameterType)5 DecimalFormat (java.text.DecimalFormat)5 DataInput (org.eclipse.bpmn2.DataInput)5 NormalDistributionType (bpsim.NormalDistributionType)4 PoissonDistributionType (bpsim.PoissonDistributionType)4 TimeParameters (bpsim.TimeParameters)4 UniformDistributionType (bpsim.UniformDistributionType)4 List (java.util.List)4 Assignment (org.eclipse.bpmn2.Assignment)4 DataInputAssociation (org.eclipse.bpmn2.DataInputAssociation)4 DataOutput (org.eclipse.bpmn2.DataOutput)4 FormalExpression (org.eclipse.bpmn2.FormalExpression)4 InputOutputSpecification (org.eclipse.bpmn2.InputOutputSpecification)4 InputSet (org.eclipse.bpmn2.InputSet)4