Package org.eclipse.xsd

Examples of org.eclipse.xsd.XSDSchema


          !ctPackage.getQualifiedName().startsWith("jbprocess")){
        if (ctPackage != null && xsdSchemaMap.get(ctPackage) == null){
          String targetNamespace = ctPackage.getQualifiedName();
          targetNamespace = targetNamespace.replaceAll("\\s", "");     
         
          XSDSchema s = XSDFactory.eINSTANCE.createXSDSchema();
          s.setSchemaForSchemaQNamePrefix("xsd");
          java.util.Map qNamePrefixToNamespaceMap = s.getQNamePrefixToNamespaceMap();
          qNamePrefixToNamespaceMap.put(s.getSchemaForSchemaQNamePrefix(),
              XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
          s.setElementFormDefault(XSDForm.get(XSDForm.QUALIFIED));
          s.setAttributeFormDefault(XSDForm.get(XSDForm.QUALIFIED));     
          s.setTargetNamespace(targetNamespace);
         
          //XSDResourceImpl res = new XSDResourceImpl();     
          //res.getContents().add(s);
         
          String prefix = "ns" + namespaceCounter++;
View Full Code Here


        seen.add(definition);
       
        // Check for built-in types
        // TODO Slightly inefficient to evaluate this when recursing

        XSDSchema schema = null;
        String namespace = qname.getNamespaceURI();
       
        if ("".equals(namespace)) { //$NON-NLS-1$
            namespace = null;
        }
View Full Code Here

          wsdlDef.setTargetNamespace(targetNamespace);
          wsdlDef.setQName(new QName(targetNamespace,"",prefix))
          wsdlNsPrefixMap.put(targetNamespace, prefix);
          wsdlDependencies.put(wsdlDef, new Vector<XSDSchema>());   
         
          XSDSchema schema = XSDFactory.eINSTANCE.createXSDSchema();
          schema.setTargetNamespace(wsdlDef.getTargetNamespace());         
          schema.setSchemaForSchemaQNamePrefix(XML_SCHEMA_NAMESPACE_PREFIX);
          java.util.Map qNamePrefixToNamespaceMap = schema.getQNamePrefixToNamespaceMap();
          qNamePrefixToNamespaceMap.put(schema.getSchemaForSchemaQNamePrefix(),
              XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
          qNamePrefixToNamespaceMap.put(wsdlNsPrefixMap.get(wsdlDef.getTargetNamespace()), wsdlDef.getTargetNamespace());
          schema.setElementFormDefault(XSDForm.get(XSDForm.QUALIFIED));
          schema.setAttributeFormDefault(XSDForm.get(XSDForm.QUALIFIED));
          Types types = WSDLFactory.eINSTANCE.createTypes();
   
          XSDSchemaExtensibilityElement xsdExtElement = WSDLFactory.eINSTANCE.createXSDSchemaExtensibilityElement();
          xsdExtElement.setSchema(schema);       
          wsdlDef.setTypes(types);
View Full Code Here

  void createTypeToComplexTypeMapping(CtSimpleType ctSimpleType){
   
    if (ctSimpleType instanceof CtClass || ctSimpleType instanceof CtInterface){
      XSDComplexTypeDefinition complexType = typeXSDComplexTypeMap.get(ctSimpleType);
      if (complexType == null){
        XSDSchema schema = xsdSchemaMap.get(ctSimpleType.getPackage());     
       
        complexType = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
        complexType.setTargetNamespace(schema.getTargetNamespace());
        complexType.setName(ctSimpleType.getSimpleName());
       
        XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
        XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
        modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
        particle.setContent(modelGroup);   
        complexType.setContent(particle);
        try {
          schema.getContents().add(complexType);
        }catch(Exception e){
          System.out.println(e.getMessage());
          e.printStackTrace();
        }
        typeXSDComplexTypeMap.put(ctSimpleType, complexType);
View Full Code Here

        part.setTypeDefinition(xsdType);
        operation.getInput().getMessage().addPart(part);
        wsdlRpcLitParamMap.put(parameter,part);
      }
    }
    XSDSchema schema = xsdType.getSchema();
    if (schema != null && !schema.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)){
      Vector<XSDSchema> dependencies = wsdlDependencies.get(operation.getEnclosingDefinition());
      if (!dependencies.contains(schema))
        dependencies.add(schema);
    }
  }
View Full Code Here

  <T> void createWsdlStyleMapping(CtMethod<T> m, Operation operation, String operationName, javax.jws.soap.SOAPBinding.Style style, javax.jws.soap.SOAPBinding.Use use, javax.jws.soap.SOAPBinding.ParameterStyle parameterStyle){
    if (style == javax.jws.soap.SOAPBinding.Style.DOCUMENT && use == javax.jws.soap.SOAPBinding.Use.LITERAL){
      // document style message contains one part.  this part refers to an element which contains a sub-element for each parameter
      //  this function adds the part and the top-level element, the sub-elements are added when the parameter is scanned
      if (parameterStyle == javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED){
        XSDSchema schema = wsdlTypesSchemaMap.get(operation.getEnclosingDefinition());
       
        XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
        XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
        modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
        particle.setContent(modelGroup);
       
        XSDComplexTypeDefinition complexType = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
        complexType.setContent(particle);
       
        XSDElementDeclaration elIn = XSDFactory.eINSTANCE.createXSDElementDeclaration();
        elIn.setName(operationName);
        elIn.setAnonymousTypeDefinition(complexType);
        schema.getContents().add(elIn);
       
        Part partIn = WSDLFactory.eINSTANCE.createPart();
        partIn.setName("parameters");
        partIn.setElementDeclaration(elIn);
        operation.getInput().getMessage().addPart(partIn);
       
        particle = XSDFactory.eINSTANCE.createXSDParticle();
        modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
        modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
        particle.setContent(modelGroup);
       
        complexType = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition();
        complexType.setContent(particle);
       
        XSDElementDeclaration elOut = XSDFactory.eINSTANCE.createXSDElementDeclaration();
        elOut.setName(operationName + "Response");
        elOut.setAnonymousTypeDefinition(complexType);
        schema.getContents().add(elOut);
       
        Part partOut = WSDLFactory.eINSTANCE.createPart();
        partOut.setName("parameters");
        partOut.setElementDeclaration(elOut);
        operation.getOutput().getMessage().addPart(partOut);
View Full Code Here

              //} else {
                createTypeToComplexTypeMapping(reference.getDeclaration());
              //}
              typeRefNodeData.xsdType = typeXSDComplexTypeMap.get(reference.getDeclaration());
              if (typeRefNodeData.xsdType != null){
                XSDSchema schema = xsdSchemaMap.get(reference.getDeclaration().getPackage());
                if (schema != null){
                  typeRefNodeData.xsdTypeQName = new QName(typeRefNodeData.xsdType.getSchema().getTargetNamespace(),typeRefNodeData.xsdType.getName(),schemaNsPrefixMap.get(typeRefNodeData.xsdType.getSchema().getTargetNamespace()));
                }
              }
            }
View Full Code Here

  @SuppressWarnings("unchecked")
  void writeSchemas(){   
    Iterator<XSDSchema> schemas = xsdSchemaMap.values().iterator();
    while(schemas.hasNext()){
      XSDSchema schema = schemas.next();
      addSchemaImports(schema);
      try {       
        String fileName = "schema" + schemaCounter++ + ".xsd";
        schemaFileMap.put(schema, fileName);
        schema.setSchemaLocation(fileName);
        schema.updateElement();
        schema.updateDocument();
        write(schema.getElement(),fileName);                     
      } catch (Exception e){
        System.err.println("Error writing XML Schema: " + e.getMessage());
      }
    }
  }
View Full Code Here

            builder = new VersionedSchemaBuilder(wfs.getGeoServer(), configuration);
        } else {
            builder = new FeatureTypeSchemaBuilder.GML3(wfs.getGeoServer());
        }

        XSDSchema schema = builder.build(results.getFeatureTypeInfo(), req.getBaseUrl());

        // serialize
        schema.updateElement();
        XSDResourceImpl.serialize(output, schema.getElement());
    }
View Full Code Here

            // Get some metadata about the XSD ...
            String encoding = parser.getEncoding();

            // Convert the XSD to content ...
            XSDSchema schema = parser.getSchema();
            process(schema, encoding, contentSize.get(), outputNode);

        } finally {
            try {
                if (reader != null) reader.close();
View Full Code Here

TOP

Related Classes of org.eclipse.xsd.XSDSchema

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.