Package org.jboss.ws.tools

Examples of org.jboss.ws.tools.JavaToXSD


   /** Get the Schema as an XSModel */
   public XSModel generateSchemaXSModel(QName xmlType, Class javaType) throws Exception
   {
      String nsuri = xmlType.getNamespaceURI();
      JavaToXSD javaToXSD = new JavaToXSD();
      return javaToXSD.generateForSingleType(xmlType, javaType);
   }
View Full Code Here


   }

   /** Parse a schema */
   public XSModel parseSchema(URL url)
   {
      JavaToXSD javaToXSD = new JavaToXSD();
      return javaToXSD.parseSchema(url);
   }
View Full Code Here

    * @param schemaLocationsMap
    * @return
    */
   public XSModel parseSchema(Map schemaLocationsMap)
   {
      JavaToXSD javaToXSD = new JavaToXSD();
      return javaToXSD.parseSchema(schemaLocationsMap);
   }
View Full Code Here

   protected XSModel getSchemaModel(QName xmlType, Class javaType) throws Exception
   {
      File xsdFile = new File("resources/common/jbossxb/ComplexTypesService_RPC.xsd");
      assertTrue(xsdFile.exists());

      return new JavaToXSD().parseSchema(xsdFile.toURL());
   }
View Full Code Here

      Map map = new HashMap();
      map.put(typeNS,new File("resources/tools/wsdlfixture/customtype/CustomTypeObj.xsd").toURL());
      map.put(arrTypeNS,new File("resources/tools/wsdlfixture/customtype/CustomTypeArrays.xsd").toURL());

      XSModel xsmodel = new JavaToXSD().parseSchema(map);
      assertNotNull("XSModel is null?", xsmodel);

      XSNamedMap xsnamedmap = getXSNamedMap(xsmodel, typeNS);
      assertNotNull("XSNamedMap is null?", xsnamedmap);
      assertEquals(1, xsnamedmap.getLength());
View Full Code Here

            "</sequence>" +
            "</complexType>" +
            "</schema>";
       String targetNS = "http://org/jboss/test/ws/jaxb/simple";
       QName qn = new QName(targetNS,"SimpleUserType", Constants.PREFIX_TNS);
       JavaToXSD jxsd = new JavaToXSD();
       //String act = jxsd.generateSchemaAsString(qn,SimpleUserType.class) ;
       String act = jxsd.generateForSingleType(qn,SimpleUserType.class).serialize() ;
       Element expEl =  DOMUtils.parse(exp);
       Element actEl =  DOMUtils.parse(act);
       assertEquals(expEl,actEl);
       //assertEquals(exp,act);
    }
View Full Code Here

              "</schema>";
       String TARGET_NAMESPACE = "http://org.jboss.ws/types";
       QName xmlType = new QName(TARGET_NAMESPACE, "Derived", "ns1");
       String nsuri = xmlType.getNamespaceURI();

       JavaToXSD javaToXSD = new JavaToXSD();
       Map packageNamespace = new HashMap();
       packageNamespace.put(Derived.class.getPackage().getName(), nsuri);
       javaToXSD.setPackageNamespaceMap(packageNamespace);

       JBossXSModel xsmodel =  javaToXSD.generateForSingleType(xmlType, Derived.class);
       Element expEl =  DOMUtils.parse(exp);
       Element actEl =  DOMUtils.parse(xsmodel.serialize());
       assertEquals(expEl,actEl);
    }
View Full Code Here

public class AnonTypesTestCase extends JBossWSTest
{
   public void testAnonTypes() throws Exception
   {
      String targetNS = "http://org.jboss.ws";
      JavaToXSD jxsd = new JavaToXSD();
      QName q = new QName(targetNS,"Items", Constants.PREFIX_TNS);
      jxsd.getSchemaCreator().addPackageNamespaceMapping(Items.class.getPackage().getName(), targetNS);
      String xs = jxsd.generateForSingleType(q,Items.class).serialize();
      File xsdFile = new File("resources/tools/jbws-204/wscompile/anontypes_new.xsd");
      checkXMLFiles(xsdFile.toURL(),xs);
   }
View Full Code Here

public class NillableTypesTestCase extends JBossWSTest
{
    public void testNillableTypes() throws Exception
    {
       String targetNS = "http://org.jboss.ws";
       JavaToXSD jxsd = new JavaToXSD();
       QName q = new QName(targetNS,"NillableType", Constants.PREFIX_TNS);
       XSTypeDefinition xst = jxsd.getSchemaCreator().generateType(q,NillableType.class);
       WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
       JBossXSModel xsmodel = sutils.createXSModel();
       xsmodel.addXSTypeDefinition(xst);
       StringWriter sw = new StringWriter();
       sutils.serialize(xsmodel,sw);
View Full Code Here

      assertEquals(expEl, actEl);
   }

   private void setUpFeatures(String ns)
   {
      jxsd = new JavaToXSD();
   }
View Full Code Here

TOP

Related Classes of org.jboss.ws.tools.JavaToXSD

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.