Examples of XSDHelper


Examples of commonj.sdo.helper.XSDHelper

        List types = xsdHelper.define(modelURL.openStream(), modelURL.toString());
        assertEquals(2, types.size());
    }

    public void testDefineWithNoLocation() {
        XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper());
        List types = xsdHelper.define(getClass().getResourceAsStream(TEST_MODEL), null);
        assertEquals(2, types.size());
    }
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

        List types = xsdHelper.define(getClass().getResourceAsStream(TEST_MODEL), null);
        assertEquals(2, types.size());
    }

    public void testDuplicateDefineWithLocation() throws IOException {
        XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper());
        List types = xsdHelper.define(modelURL.openStream(), modelURL.toString());
        assertEquals(2, types.size());

        List types2 = xsdHelper.define(modelURL.openStream(), modelURL.toString());
        assertEquals(0, types2.size());
    }
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

 
  public void testDefineDataType() throws Exception
  {
    TypeHelper types = SDOUtil.createTypeHelper();
    DataFactory factory = SDOUtil.createDataFactory(types);
    XSDHelper xsdHelper = SDOUtil.createXSDHelper(types);
    XMLHelper xmlHelper = SDOUtil.createXMLHelper(types);

    Property javaClassProperty = xsdHelper.getGlobalProperty("commonj.sdo/java", "javaClass", false);
   
    // create a data types
    DataObject intType = factory.create("commonj.sdo", "Type");
    intType.set("uri", "http://example.com/customer");
    intType.set("name", "MyIntType");
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

  public static void generateFromXMLSchema(String xsdFileName, String namespace, 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);

    try
    {
      File inputFile = new File(xsdFileName).getAbsoluteFile();
      InputStream inputStream = new FileInputStream(inputFile);
      xsdHelper.define(inputStream, inputFile.toURI().toString());

      if (targetDirectory == null)
      {
        targetDirectory = new File(xsdFileName).getCanonicalFile().getParent();
      }
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

            typeHelper = SDOUtil.createTypeHelper();
            XSDHelper xsdHelper = SDOUtil.createXSDHelper(typeHelper);
            URL url = getClass().getResource("helloworld.wsdl");
            xsdHelper.define(url.openStream(), null);
            url = getClass().getResource("CreditScoreDocLitWrapped.wsdl");
            xsdHelper.define(url.openStream(), null);
            url = getClass().getResource("CreditScoreDocLit.wsdl");
            xsdHelper.define(url.openStream(), null);

            this.greetingDB = new SDODataBinding(getClass().getClassLoader(),typeHelper, GREETING_QN, true);
            this.docLitWrappedDB = new SDODataBinding(getClass().getClassLoader(),typeHelper, DOCLITWRAPPED_QN, true);

            this.docLitDB = new SDODataBinding(getClass().getClassLoader(),typeHelper, DOCLIT_QN, false);
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try {
            appCL = getClass().getClassLoader();
            Thread.currentThread().setContextClassLoader(appCL);
            typeHelper = SDOUtil.createTypeHelper();
            XSDHelper xsdHelper = SDOUtil.createXSDHelper(typeHelper);
            URL url = getClass().getResource("helloworld.wsdl");
            xsdHelper.define(url.openStream(), null);
            url = getClass().getResource("CreditScoreDocLit.wsdl");
            xsdHelper.define(url.openStream(), null);
            greetingDOB = SDOXMLHelper.toDataObject(appCL, typeHelper, new Object[] { GREETING_NAME }, GREETING_QN, true);
            greetingXML = SDOXMLHelper.toXMLBytes(appCL, typeHelper, new Object[] { GREETING_NAME }, GREETING_QN, true);

            DataFactory dataFactory = SDOUtil.createDataFactory(typeHelper);
            nonWrappedDOB = dataFactory.create("http://www.example.org/creditscore/doclit/", "Customer");
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

            try {
//                Thread.currentThread().setContextClassLoader(resourceLoader.getClassLoader());
                InputStream xsdInputStream = wsdlURL.openStream();
                try {
                    AssemblyContext context = registry.getContext();
                    XSDHelper xsdHelper = SDOUtil.createXSDHelper(context.getTypeHelper());
                    xsdHelper.define(xsdInputStream, null);
                } finally {
                    xsdInputStream.close();
                }
            } catch (IOException e) {
                SidefileLoadException sfe = new SidefileLoadException(e.getMessage());
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

     * @param os
     * @return the DataObject
     * @deprecated TUSCANY-333 use the method that takes a ClassLoader
     */
    public static DataObject toDataObject(TypeHelper typeHelper, Object[] os, QName elementQName, boolean isWrapped) {
        XSDHelper xsdHelper = SDOUtil.createXSDHelper(typeHelper);

        Property property = xsdHelper.getGlobalProperty(elementQName.getNamespaceURI(), elementQName.getLocalPart(), true);
        if (null == property) {
            throw new InvocationRuntimeException("Type '" + elementQName.toString() + "' not found in registered SDO types.");
        }
        if (isWrapped) {
            DataFactory dataFactory = SDOUtil.createDataFactory(typeHelper);
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

        loader.setWsdlRegistry(wsdlRegistry);
        registerLoader(loader);
       
        InputStream xsdInputStream = wsdlURL.openStream();
        try {
            XSDHelper xsdHelper = SDOUtil.createXSDHelper(modelContext.getTypeHelper());
            xsdHelper.define(xsdInputStream, null);
        } finally {
            xsdInputStream.close();
        }
    }
View Full Code Here

Examples of commonj.sdo.helper.XSDHelper

    protected void setUp() throws Exception {
        super.setUp();
        this.script = readResource(scriptName);
        TypeHelper th = SDOUtil.createTypeHelper();
        XSDHelper xsdHelper = new XSDHelperImpl(th);
        URL url = getClass().getResource("helloworld.wsdl");
        xsdHelper.define(url.openStream(), null);

        dataBinding = new E4XDataBinding(getClass().getClassLoader(),th);
        dataBinding.addElementQName("getGreetings", new QName("http://helloworld.samples.tuscany.apache.org", "getGreetings"));
    }
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.