Package org.eclipse.emf.ecore.util

Examples of org.eclipse.emf.ecore.util.ExtendedMetaData


        } else {
          callActivity.setName("");
        }
     
      if(properties.get("independent") != null && properties.get("independent").length() > 0) {
        ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
            EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
                    "http://www.jboss.org/drools", "independent", false, false);
            SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
                    properties.get("independent"));
            callActivity.getAnyAttribute().add(extensionEntry);
      }
     
      if(properties.get("waitforcompletion") != null && properties.get("waitforcompletion").length() > 0) {
        ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
            EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
                    "http://www.jboss.org/drools", "waitForCompletion", false, false);
            SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
                    properties.get("waitforcompletion"));
            callActivity.getAnyAttribute().add(extensionEntry);
      }
     
      if(properties.get("calledelement") != null && properties.get("calledelement").length() > 0) {
        callActivity.setCalledElement(properties.get("calledelement"));
      }
     
      //callActivity data input set
        if(properties.get("datainputset") != null && properties.get("datainputset").trim().length() > 0) {
            String[] allDataInputs = properties.get("datainputset").split( ",\\s*" );
            if(callActivity.getIoSpecification() == null) {
                InputOutputSpecification iospec = Bpmn2Factory.eINSTANCE.createInputOutputSpecification();
                callActivity.setIoSpecification(iospec);
            }
            InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet();
            for(String dataInput : allDataInputs) {
              if(dataInput.trim().length() > 0) {
                  DataInput nextInput = Bpmn2Factory.eINSTANCE.createDataInput();
                  String[] dataInputParts = dataInput.split( ":\\s*" );
                  if(dataInputParts.length == 2) {
                    nextInput.setId(callActivity.getId() + "_" + dataInputParts[0] + "InputX");
                    nextInput.setName(dataInputParts[0]);
                   
                    ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
                      EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
                              "http://www.jboss.org/drools", "dtype", false, false);
                      SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
                          dataInputParts[1]);
                      nextInput.getAnyAttribute().add(extensionEntry);
                  } else {
                    nextInput.setId(callActivity.getId() + "_" + dataInput + "InputX");
                    nextInput.setName(dataInput);

                        ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
                        EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
                                "http://www.jboss.org/drools", "dtype", false, false);
                        SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
                                "Object");
                        nextInput.getAnyAttribute().add(extensionEntry);
                  }
                  callActivity.getIoSpecification().getDataInputs().add(nextInput);
                  inset.getDataInputRefs().add(nextInput);
              }
            }
            callActivity.getIoSpecification().getInputSets().add(inset);
        } else {
            if(callActivity.getIoSpecification() != null) {
              callActivity.getIoSpecification().getInputSets().add(Bpmn2Factory.eINSTANCE.createInputSet());
            }
        }
       
        //callActivity data output set
        if(properties.get("dataoutputset") != null && properties.get("dataoutputset").trim().length() > 0) {
            String[] allDataOutputs = properties.get("dataoutputset").split( ",\\s*" );
            if(callActivity.getIoSpecification() == null) {
                InputOutputSpecification iospec = Bpmn2Factory.eINSTANCE.createInputOutputSpecification();
                callActivity.setIoSpecification(iospec);
            }

            OutputSet outset = Bpmn2Factory.eINSTANCE.createOutputSet();
            for(String dataOutput : allDataOutputs) {
              if(dataOutput.trim().length() > 0) {
                  DataOutput nextOut = Bpmn2Factory.eINSTANCE.createDataOutput();
                  String[] dataOutputParts = dataOutput.split( ":\\s*" );
                  if(dataOutputParts.length == 2) {
                    nextOut.setId(callActivity.getId() + "_" + dataOutputParts[0] + "OutputX");
                    nextOut.setName(dataOutputParts[0]);
                   
                    ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
                      EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
                              "http://www.jboss.org/drools", "dtype", false, false);
                      SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
                          dataOutputParts[1]);
                      nextOut.getAnyAttribute().add(extensionEntry);
                  } else {
                    nextOut.setId(callActivity.getId() + "_" + dataOutput + "OutputX");
                    nextOut.setName(dataOutput);

                        ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
                        EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
                                "http://www.jboss.org/drools", "dtype", false, false);
                        SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
                                "Object");
                        nextOut.getAnyAttribute().add(extensionEntry);
                  }
View Full Code Here


                    options.put(OPTION_XML_OPTIONS, xmlOptions);
                }
                xmlOptions.setProcessSchemaLocations(true);
                if (option == null)
                    option = getDefaultLoadOptions().get(OPTION_EXTENDED_META_DATA);
                ExtendedMetaData extendedMetaData;
                final XSDHelper xsdHelper;
                if (option == null) {
                    extendedMetaData = ExtendedMetaData.INSTANCE;
                    xsdHelper = XSDHelper.INSTANCE;
                } else {
View Full Code Here

 
  public Resource createResource(URI uri)
  {
    XMLResourceImpl result = new DataGraphResourceImpl(uri);

    ExtendedMetaData extendedMetaData = ((TypeHelperImpl)TypeHelper.INSTANCE).getExtendedMetaData();
    DataObjectUtil.configureXMLResource(result, extendedMetaData);
   
    result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
    result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.TRUE);
    //result.setEncoding("UTF-8");
View Full Code Here

 
  public Resource createResource(URI uri)
  {
    XMLResourceImpl result = new DataGraphResourceImpl(uri);

    ExtendedMetaData extendedMetaData = ((TypeHelperImpl)TypeHelper.INSTANCE).getExtendedMetaData();
    DataObjectUtil.configureXMLResource(result, extendedMetaData);
   
    result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
    result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.TRUE);
    //result.setEncoding("UTF-8");
View Full Code Here

   */
  public static void generateFromXMLSchema(String xsdFileName, String targetDirectory, String javaPackage, String prefix, int genOptions)
  {
    DataObjectUtil.initRuntime();
    EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
    ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
    XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData, null);

    try
    {
      File inputFile = new File(xsdFileName).getAbsoluteFile();
View Full Code Here

  protected static void generateFromXMLSchema(String xsdFileName, String namespace, String targetDirectory, String javaPackage, String prefix, int genOptions, String regenerateBuiltIn)
  {
    DataObjectUtil.initRuntime();
    EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
    ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
    XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData, regenerateBuiltIn);

    try
    {
      File inputFile = new File(xsdFileName).getAbsoluteFile();
View Full Code Here

   * @deprecated see {@link #createHelperContext(TypeHelper)}
   */
  public static TypeHelper createTypeHelper()
  {
    EPackage.Registry registry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
    ExtendedMetaData extendedMetaData = new SDOExtendedMetaDataImpl(registry); //TODO create subclass that makes demand() methods synchronous
    return new TypeHelperImpl(extendedMetaData);
  }
View Full Code Here

    return "".equals(SDOExtendedMetaData.INSTANCE.getName((EClassifier)type));
  }
 
  public static Type createType(TypeHelper scope, String uri, String name, boolean isDataType)
  {
    ExtendedMetaData extendedMetaData = ((TypeHelperImpl)scope).getExtendedMetaData();
    if ("".equals(uri)) uri = null; //FB
   
    EPackage ePackage = extendedMetaData.getPackage(uri);
    if (ePackage == null)
    {
      ePackage = EcoreFactory.eINSTANCE.createEPackage();
      ePackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl());
      ePackage.setNsURI(uri);
      String packagePrefix = uri != null ? URI.createURI(uri).trimFileExtension().lastSegment() : ""; //FB
      ePackage.setName(packagePrefix);
      ePackage.setNsPrefix(packagePrefix);
      extendedMetaData.putPackage(uri, ePackage);
    }

    EClassifier eClassifier = ePackage.getEClassifier(name);
    if (eClassifier != null) // already defined?
    {
View Full Code Here

    return (Property)eStructuralFeature;
  }
 
  public static Property createGlobalProperty(TypeHelper scope, String uri, String name, Type type)
  {
    ExtendedMetaData extendedMetaData = ((TypeHelperImpl)scope).getExtendedMetaData();

    // get/create document root
    EPackage ePackage = extendedMetaData.getPackage(uri);
    Type documentRoot = ePackage != null ? (Type)extendedMetaData.getType(ePackage, "") : null;
    if (documentRoot == null)
    {
      documentRoot = SDOUtil.createType(scope, uri, null, false);
    }
View Full Code Here

     * @generated NOT
     */
    @Override
    public Resource createResource(URI uri) {
        Bpmn2ResourceImpl result = new Bpmn2ResourceImpl(uri);
        ExtendedMetaData extendedMetadata = new XmlExtendedMetadata();
        result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
        result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetadata);
    
        //((Delegator)EPackage.Registry.INSTANCE).put("http://www.founderfix.com/fixflow", Bpmn2Package.eINSTANCE);
       
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.util.ExtendedMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.