Examples of DynamicElementRule


Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

            // in pass through so we must not process this event, just
            // pass it straight through to the next process
            super.startElement(namespaceURI, localName, qName, atts);
        } else {
            // check to see if a rule has been registered against this element
            DynamicElementRule rule = retrieveRule(namespaceURI, localName);

            // if a rule has been registered then execute it
            if (rule != null) {
                Object object = null;
                try {
                    object = rule.startElement(dynamicProcess,
                                                      searchName,
                                                      atts);
                    // store the returned object away so that we can use it
                    // when end element for this rule is invoked
                } finally {
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

            // in pass through so we must not process this event, just
            // pass it straight through to the next process
            super.endElement(namespaceURI, localName, qName);
        } else {
            // check to see if a rule has been registered against this element
            DynamicElementRule rule = retrieveRule(namespaceURI, localName);

            // if a rule has been registered then execute it
            if (rule != null) {
                // retrieve the object that this rule returned when its
                // startElement method was invoked
                Object object = objects.pop();
                // invoke the endElement method
                rule.endElement(dynamicProcess, searchName, object);
                // As rule was found so we must consume this pipeline event
            } else {
                // no rule found so forward event to next process
                super.endElement(namespaceURI, localName, qName);
            }
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

    public DynamicElementRule getRule(ExpandedName element) {
        if (element == null) {
            throw new IllegalArgumentException(
                    "element argument cannot be null");
        }
        DynamicElementRule rule = null;
        // retrieve the NamespaceRuleSet for the given namespace
        NamespaceRuleSet namespaceRules =
                getNamespaceRules(element.getNamespaceURI());
        // if a rule set was found then look for a rule.
        if (namespaceRules != null) {
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

        addAttribute("name", name);
        addAttribute("value", value);
        addAttribute("from", from);

        DynamicElementRule rule = new HeaderRule(entityFactoryMock);
        XMLProcess process = (XMLProcess) rule.startElement(dynamicProcessMock,
                elementName, attributes);

        dynamicProcessMock.expects.removeProcess(process);

        rule.endElement(dynamicProcessMock, elementName, process);

        assertNotNull(header);

        if (name == null) {
            assertEquals("Name value should match", from,
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

        // =====================================================================

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        DynamicElementRule rule = new ScriptRule();
        doStartFailure(rule,
                "Script tag should have the 'ref' parameter set. " +
                "Value is: ref='null'");
    }
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

                });

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        DynamicElementRule rule = new ScriptRule();

        addAttribute("ref", ref);

        rule.startElement(dynamicProcessMock, elementName, attributes);
    }
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

        addAttribute("maxAge", Integer.toString(maxAge));
        addAttribute("path", path);
        addAttribute("secure", "" + secure);
        addAttribute("version", version.getName());

        DynamicElementRule rule = new CookieRule(entityFactoryMock);
        XMLProcess process = (XMLProcess) rule.startElement(dynamicProcessMock,
                elementName, attributes);

        dynamicProcessMock.expects.removeProcess(process);

        rule.endElement(dynamicProcessMock, elementName, process);

        assertNotNull(cookie);

        assertEquals("Name should match", name,
                cookie.getName());
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

        addAttribute("name", name);
        addAttribute("value", value);
        addAttribute("from", from);
        addAttribute("target", target);

        DynamicElementRule rule = new ParameterRule(entityFactoryMock);
        XMLProcess process = (XMLProcess) rule.startElement(dynamicProcessMock,
                elementName, attributes);

        dynamicProcessMock.expects.removeProcess(process);

        rule.endElement(dynamicProcessMock, elementName, process);

        assertNotNull(parameter);

        if (name == null) {
            assertEquals("Name value should match", from,
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

    public void testMissingAttributes() throws Exception {

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        DynamicElementRule rule = new ContentRule();

        doStartFailure(rule,
                "Content tag should have 'action' and 'type' " +
                "parameter set. Values are: action='null', type='null'");
    }
View Full Code Here

Examples of com.volantis.xml.pipeline.sax.dynamic.DynamicElementRule

        // =====================================================================
        //   Test Expectations
        // =====================================================================


        DynamicElementRule rule = new ContentRule();

        doTest("ignore", "type-ignore", rule, ContentAction.IGNORE);

        doTest("consume", "type-consume", rule, ContentAction.CONSUME);
    }
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.