Package com.volantis.mcs.dom

Examples of com.volantis.mcs.dom.DOMFactory


    // javadoc inherited
    public Document transform(DOMProtocol protocol,
                              Document document) {
        // Create a dummy cell to hold and process the entire layout
        DOMFactory factory = protocol.getDOMFactory();
        Cell startPoint = new Cell(factory, null, null);

        // Do the transformation
        startPoint.transform(document);
View Full Code Here


     * protocol's DOM pool, if available.
     *
     * @return a newly allocated DOM element
     */
    private Element allocateElement() {
        DOMFactory factory = protocol.getDOMFactory();
        return factory.createElement();
    }
View Full Code Here

    private static final String FORM_NAME = "testForm";
    private static final String FORM_SPECIFIER = "s0";

    public void testGetDepthInValidStructure() throws IOException, SAXException {
        DOMFactory factory = DOMFactory.getDefaultInstance();

        Element element = factory.createElement();
        element.setName("0");
        Element[] elements = createElementHierarchy(factory, element, 20, 13,
                20, "A");
        Element mainTrunkBottom = elements[0];
        Element branchBottom = elements[1];
View Full Code Here

        // Create test objects.
        StyledDOMTester tester = new StyledDOMTester();
        Document dom = tester.parse(getClass().getResourceAsStream(
                "testInsertXFormEmulationElement.xml"));

        DOMFactory domFactory = DOMFactory.getDefaultInstance();
        Element firstControl = selectNamedElement(dom, "html");
        Element lastControl = selectNamedElement(dom, "body");

        // Create Mocks.
        ProtocolSupportFactoryMock psf =
View Full Code Here

        // Create test objects.
        StyledDOMTester tester = new StyledDOMTester();
        Document dom = tester.parse(getClass().getResourceAsStream(
                "testInsertXFormEmulationElement.xml"));

        DOMFactory domFactory = DOMFactory.getDefaultInstance();
        Element firstControl = selectNamedElement(dom, "html");
        Element lastControl = selectNamedElement(dom, "body");

        // Create Mocks.
        ProtocolSupportFactoryMock psf =
View Full Code Here

        StyledDOMTester tester = new StyledDOMTester();
        Document dom = tester.parse(getClass().getResourceAsStream(
                "testInsertXFormEmulationElement.xml"));

        // Create test objects.
        DOMFactory domFactory = DOMFactory.getDefaultInstance();
        Element emulatedXFormElement =
                domFactory.createElement("EMULATED_XFORM_ELEMENT");
        Element vFormElement = domFactory.createElement("VFORM_ELEMENT");
        XFFormAttributes attributes = new XFFormAttributes();
        Element firstControl = selectNamedElement(dom, "FIRST_CONTROL");
        Element lastControl = selectNamedElement(dom, "SECOND_CONTROL");
        Element div = selectNamedElement(dom, "div");
View Full Code Here

        StyledDOMTester tester = new StyledDOMTester();
        Document dom = tester.parse(getClass().getResourceAsStream(
                "testInsertXFormEmulationElement.xml"));

        // Create test objects.
        DOMFactory domFactory = DOMFactory.getDefaultInstance();
        Element emulatedXFormElement =
                domFactory.createElement("EMULATED_XFORM_ELEMENT");
        Element vFormElement = domFactory.createElement("VFORM_ELEMENT");
        XFFormAttributes attributes = new XFFormAttributes();
        Element firstControl = selectNamedElement(dom, "FIRST_CONTROL");
        Element lastControl = selectNamedElement(dom, "SECOND_CONTROL");
        Element b = selectNamedElement(dom, "b");
View Full Code Here

    private void prepareEmulator(XFormEmulator emulator, StyledDOMTester tester, String inputFilePath, boolean nullify) {
        // Create test objects.
        Document dom = tester.parseFull(getClass().getResourceAsStream(
                inputFilePath));

        DOMFactory domFactory = DOMFactory.getDefaultInstance();

        // Create Mocks.
        ProtocolSupportFactoryMock psf =
                new ProtocolSupportFactoryMock("psf", expectations);
        ProtocolConfigurationMock configuration =
View Full Code Here

                        // Pre-populate the array with empty rows so
                        // that the array is correctly sized for the
                        // number of rows actually needed and that
                        // rows that need spanning will be available
                        // (and empty) in the final DOM
                        DOMFactory factory = protocol.getDOMFactory();

                        newRows.ensureCapacity(requiredRows);

                        for (int i = newRows.size();
                             i < requiredRows;
                             i++) {
                            // Allocate a new row element
                            currentRow = factory.createElement();

                            // Duplicate the original row and insert
                            // the new row after the previous row (and
                            // into the newRows array).
                            currentRow.copy(outerRow);
View Full Code Here

     * @param textAfterStrongElement the text to use after the strong element
     */
    private void createTestDocument(String textBeforeStrongElement,
                                    String textWithinStrongElement,
                                    String textAfterStrongElement) {
        DOMFactory factory = DOMFactory.getDefaultInstance();

        rootElement = factory.createElement("body");

        Text text = factory.createText();
        text.append(textBeforeStrongElement);

        rootElement.addTail(text);

        strongElement = factory.createElement("strong");

        Text strongText = factory.createText();
        strongText.append(textWithinStrongElement);
        strongElement.addTail(strongText);

        rootElement.addTail(strongElement);

        Text textNodeAfterStrongElement = factory.createText();
        textNodeAfterStrongElement.append(textAfterStrongElement);

        rootElement.addTail(textNodeAfterStrongElement);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom.DOMFactory

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.