Package commonj.sdo.helper

Examples of commonj.sdo.helper.XMLHelper.load()


        handler = new SDOWrapperHandler();
    }

    public void testWrapperAnyType() throws Exception {
        XMLHelper xmlHelper = context.getXMLHelper();
        XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
        Operation op = new OperationImpl();
        List children = handler.getChildren(document, op, true);
        assertEquals(5, children.size());
    }
View Full Code Here


    public void testWrapper() throws Exception {
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
        XMLHelper xmlHelper = context.getXMLHelper();
        XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
        Operation op = new OperationImpl();
        List children = handler.getChildren(document, op, true);
        assertEquals(5, children.size());
    }
   
View Full Code Here

      for (Iterator iter = getTypeMetaData().iterator(); iter.hasNext();)
      {
        TypeMetaData metadata = (TypeMetaData)iter.next();
        URL url = getClass().getResource(metadata.getLocation());
        InputStream inputStream = url.openStream();
        XMLDocument xmlDocument = xmlHelper.load(inputStream);
        Types types = (Types)xmlDocument.getRootObject();
        typeHelper.define(types.getTypeList());
      }
    }
    catch (Exception e)
View Full Code Here

        SDOUtil.registerStaticTypes(ConfigFactory.class);
        XMLHelper helper = XMLHelper.INSTANCE;

        try {
            return (Config) helper.load(configStream).getRootObject();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(customerType, "commonj.sdo", "type", baos);
   
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    XMLDocument xdoc = xmlHelper.load(bais);

    customerType = xdoc.getRootObject();
   
    // now define the Customer type so that customers can be made
    types.define(customerType);
View Full Code Here

     */
    public static DataObject toDataObject(TypeHelper typeHelper, byte[] xmlBytes) {
        try {

            XMLHelper xmlHelper = SDOUtil.createXMLHelper(typeHelper);
            XMLDocument document = xmlHelper.load(new ByteArrayInputStream(xmlBytes));

            return document.getRootObject();

        } catch (IOException e) {
            throw new ServiceRuntimeException(e);
View Full Code Here

        handler = new SDOWrapperHandler();
    }

    public void testWrapperAnyType() throws Exception {
        XMLHelper xmlHelper = context.getXMLHelper();
        XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
        List children = handler.getChildren(document, null, null);
        assertEquals(5, children.size());
    }

    public void testWrapper() throws Exception {
View Full Code Here

    public void testWrapper() throws Exception {
        XSDHelper xsdHelper = context.getXSDHelper();
        xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null);
        XMLHelper xmlHelper = context.getXMLHelper();
        XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml"));
        List children = handler.getChildren(document, null, null);
        assertEquals(5, children.size());
    }
   
    public void testCreate() {
View Full Code Here

            return null;
        }
        try {
            HelperContext helperContext = SDOContextHelper.getHelperContext(context);
            XMLHelper xmlHelper = helperContext.getXMLHelper();
            return xmlHelper.load(source).getRootObject();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

        try {
            HelperContext helperContext = SDOContextHelper.getHelperContext(context);
            XMLHelper xmlHelper = helperContext.getXMLHelper();
            Document doc = DOMHelper.promote(source);
            DOMSource domSource = new DOMSource(doc);
            XMLDocument xmlDoc = xmlHelper.load(domSource, doc.getDocumentURI(), null);
            return xmlDoc.getRootObject();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
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.