Examples of Import


Examples of org.drools.workbench.models.datamodel.imports.Import

        //Add test files
        final Path path1 = basePath.resolve( "scenario1.scenario" );
        final Scenario model1 = TestScenarioFactory.makeTestScenarioWithVerifyFact( "org.drools.workbench.screens.testscenario.backend.server.indexing",
                                                                                    new ArrayList<Import>() {{
                                                                                        add( new Import( "org.drools.workbench.screens.testscenario.backend.server.indexing.classes.Applicant" ) );
                                                                                        add( new Import( "org.drools.workbench.screens.testscenario.backend.server.indexing.classes.Mortgage" ) );
                                                                                    }},
                                                                                    "scenario1" );
        final String xml1 = ScenarioXMLPersistence.getInstance().marshal( model1 );
        ioService().write( path1,
                           xml1 );
        final Path path2 = basePath.resolve( "scenario2.scenario" );
        final Scenario model2 = TestScenarioFactory.makeTestScenarioWithoutVerifyFact( "org.drools.workbench.screens.testscenario.backend.server.indexing",
                                                                                       new ArrayList<Import>() {{
                                                                                           add( new Import( "org.drools.workbench.screens.testscenario.backend.server.indexing.classes.Applicant" ) );
                                                                                           add( new Import( "org.drools.workbench.screens.testscenario.backend.server.indexing.classes.Mortgage" ) );
                                                                                       }},
                                                                                       "scenario2" );
        final String xml2 = ScenarioXMLPersistence.getInstance().marshal( model2 );
        ioService().write( path2,
                           xml2 );
View Full Code Here

Examples of org.drools.workbench.models.datamodel.imports.Import

                    if ( line.startsWith( KEYWORD ) ) {
                        line = line.substring( KEYWORD.length() ).trim();
                        if ( line.endsWith( ";" ) ) {
                            line = line.substring( 0, line.length() - 1 );
                        }
                        imports.addImport( new Import( line ) );
                    }
                }
            }

            return imports;
View Full Code Here

Examples of org.eclipse.bpel.model.Import

   
    Iterator<?> it = process.getImports().iterator();
    EObject result = null;
   
        while ( it.hasNext() ) {
            Import imp = (Import) it.next();           
           
            // The null and "" problem ...
            String ns = imp.getNamespace();
            if (ns == null) {
              ns = javax.xml.XMLConstants.DEFAULT_NS_PREFIX;
            }
           
            if (ns.equals(qname.getNamespaceURI()) == false || imp.getLocation() == null ) {
              continue;
            }
                       
          ImportResolver[] resolvers = ImportResolverRegistry.INSTANCE.getResolvers(imp.getImportType());
            for (int i = 0; i < resolvers.length; i++)  {             
                result = resolvers[i].resolve(imp, qname, name, refType);
                if (result != null) {
                    return result;
                }
View Full Code Here

Examples of org.eclipse.bpmn2.Import

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.IMPORT: {
            Import import_ = (Import) theEObject;
            T result = caseImport(import_);
            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.schema.model.Import

                prefix = schema.getNamespaceResolver().generatePrefix(Constants.SCHEMA_PREFIX);
            } else if (URI.equals(Constants.REF_URL)) {
                prefix = schema.getNamespaceResolver().generatePrefix(Constants.REF_PREFIX);
               
                if(!importExists(schema, SWA_REF_IMPORT)){
                   Import schemaImport = new Import();
                     schemaImport.setSchemaLocation(SWA_REF_IMPORT);                    
                     schemaImport.setNamespace(URI);                    
                     schema.getImports().add(schemaImport);
                }
            } else {
                prefix = schema.getNamespaceResolver().generatePrefix();
            }
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.schema.model.Import

    }

    private boolean importExists(Schema schema, String schemaName) {
        java.util.List imports = schema.getImports();
        for (int i = 0; i < imports.size(); i++) {
            Import nextImport = (Import) imports.get(i);
            if (nextImport.getSchemaLocation() != null && nextImport.getSchemaLocation().equals(schemaName)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of org.eclipse.persistence.internal.oxm.schema.model.Import

                    schemaName = relativizedURI.getPath();
                }
            }
           
            if (schemaName != null && !importExists(sourceSchema, schemaName)) {
                Import schemaImport = new Import();
                schemaImport.setSchemaLocation(schemaName);
                if (importNamespace != null && !importNamespace.equals(EMPTY_STRING)) {
                    schemaImport.setNamespace(importNamespace);
                }
                sourceSchema.getImports().add(schemaImport);
                if (schemaImport.getNamespace() != null) {
                    if(schemaImport.getNamespace().equals(javax.xml.XMLConstants.XML_NS_URI)) {
                        //make sure xml namespace is in the resolver so it gets declared
                        sourceSchema.getNamespaceResolver().put(javax.xml.XMLConstants.XML_NS_PREFIX, javax.xml.XMLConstants.XML_NS_URI);
                    }
                    String prefix = sourceSchema.getNamespaceResolver().resolveNamespaceURI(importNamespace);
                    //Don't need to generate prefix for default namespace
View Full Code Here

Examples of org.eclipse.wst.wsdl.Import

    List imports = definition.getEImports();
    Iterator importsIterator = imports.iterator();

    while (importsIterator.hasNext())
    {
      Import theImport = (Import)importsIterator.next();

      String importLocationURI = theImport.getLocationURI();
      if (importLocationURI != null &&
      // ISSUE This assumption seems a bit weak.
        importLocationURI.endsWith("wsdl"))
      {
        Definition importedDefinition = theImport.getEDefinition();

        if (importedDefinition != null && !list.contains(importedDefinition))
        {
          // Recursively try to locate all definitions.
View Full Code Here

Examples of org.jboss.forge.parser.java.Import

   @Override
   @SuppressWarnings("unchecked")
   public Import addImport(final String className)
   {
      String strippedClassName = Types.stripGenerics(Types.stripArray(className));
      Import imprt;
      if (Types.isSimpleName(strippedClassName) && !hasImport(strippedClassName))
      {
         throw new IllegalArgumentException("Cannot import class without a package [" + strippedClassName + "]");
      }

      if (!hasImport(strippedClassName) && validImport(strippedClassName))
      {
         imprt = new ImportImpl(this).setName(strippedClassName);
         unit.imports().add(imprt.getInternal());
      }
      else if (hasImport(strippedClassName))
      {
         imprt = getImport(strippedClassName);
      }
View Full Code Here

Examples of org.jboss.forge.parser.java.source.Import

   @Override
   public Import addImport(final String className)
   {
      String strippedClassName = Types.stripGenerics(Types.stripArray(className));
      Import imprt;
      if (Types.isSimpleName(strippedClassName) && !hasImport(strippedClassName))
      {
         throw new IllegalArgumentException("Cannot import class without a package [" + strippedClassName + "]");
      }

      if (!hasImport(strippedClassName) && validImport(strippedClassName))
      {
         imprt = new ImportImpl(this).setName(strippedClassName);
         unit.imports().add(imprt.getInternal());
      }
      else if (hasImport(strippedClassName))
      {
         imprt = getImport(strippedClassName);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.