Package commonj.sdo.helper

Examples of commonj.sdo.helper.XMLDocument


        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

    @Override
    public Object copy(Object arg, DataType dataType, DataType targetDataType, Operation operation, Operation targetOperation) {
        HelperContext context = SDOContextHelper.getHelperContext(operation);
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
        } else {
            return super.copy(arg, dataType, targetDataType, operation, targetOperation);
        }
View Full Code Here

            // Load the stream into SDO
            // We are just using SDO as a convenient way to parse the XML config file
            HelperContext scope       = SDOUtil.createHelperContext();
            GenerateFactory.INSTANCE.register(scope);
            XMLDocument xmlDoc        = scope.getXMLHelper().load(fis);
            GenerateType generateType = (GenerateType)xmlDoc.getRootObject();

            // Get the file list. This is the list of XSD that is passed into the
            // the velocity templates. Each configured file holds a list of types
            // that the velocity templates expand into appropriate methods and method calls          
            List fileList = generateType.getInputFile();
View Full Code Here

            // Load the stream into SDO
            // We are just using SDO as a convenient way to parse the XML config file
            HelperContext scope       = SDOUtil.createHelperContext();
            GenerateFactory.INSTANCE.register(scope);
            XMLDocument xmlDoc        = scope.getXMLHelper().load(fis);
            GenerateType generateType = (GenerateType)xmlDoc.getRootObject();

            // Get the file list. This is the list of XSD that is passed into the
            // the velocity templates. Each configured file holds a list of types
            // that the velocity templates expand into appropriate methods and method calls          
            List fileList = generateType.getInputFile();
View Full Code Here

    @Override
    public Object copy(Object arg) {
        HelperContext context = HelperProvider.getDefaultContext();
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
        } else {
            return super.copy(arg);
        }
View Full Code Here

            name = Character.toLowerCase(name.charAt(0)) + name.substring(1, name.length());
        }

        try {
            DOMResult domResult = new DOMResult(DOMHelper.newDocument());
            XMLDocument xmlDoc = helper.createDocument(source, null, name);
            helper.save(xmlDoc, domResult, null);
            return node2NodeInfoTransformer.transform(domResult.getNode(), context);
        } catch (Exception e) {
            throw new TransformationException(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());
    }
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());
    }
View Full Code Here

            name = Character.toLowerCase(name.charAt(0)) + name.substring(1, name.length());
        }

        try {
            DOMResult domResult = new DOMResult(DOMHelper.newDocument());
            XMLDocument xmlDoc = helper.createDocument(source, null, name);
            helper.save(xmlDoc, domResult, null);
            return node2NodeInfoTransformer.transform(domResult.getNode(), context);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
View Full Code Here

TOP

Related Classes of commonj.sdo.helper.XMLDocument

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.