Package com.volantis.xml.pipeline.sax

Examples of com.volantis.xml.pipeline.sax.XMLProcess


    // Javadoc inherited.
    public void removeProcess(XMLProcess expected)
            throws SAXException {

        XMLProcess removed = removeProcess();
        // check that the correct process was removed.
        if (expected != removed) {
            XMLPipelineContext context = getPipelineContext();
            XMLPipelineException error = new XMLPipelineException(
                    "Expected to remove process " + expected +
View Full Code Here


    // javadoc inherited
    protected XMLProcess createProcess(DynamicProcess dynamicProcess,
                                       ExpandedName elementName,
                                       Attributes attributes)
                throws SAXException {
        XMLProcess process = null;
        // we only add a process if the "active" attribute is set to true
        // and a DebugOutputFilesPrefix has been set on the pipeline context.
        XMLPipelineContext context =
                    dynamicProcess.getPipeline().getPipelineContext();
        String suffix = attributes.getValue(FILE_SUFFIX_ATTRIBUTE);
View Full Code Here

        try {
            // This handler allows a string value to be collated from the value's
            // SAX events. An exception will be thrown by this handler if any
            // non-simple events are encountered
            XMLProcess handler = new XMLProcessImpl() {
                /**
                 * Used to generate a standardized fatal error message.
                 *
                 * @param event the name of the SAX event in which the error
                 *              occurred
View Full Code Here

            // The following process collects the preprocessed events
            // without permitting the events to be replayed to the rest
            // of the pipeline. This allows the preprocessing to be
            // performed before checking the complexity of the SAX
            // events
            XMLProcess process = processedEventRecorder.getRecordingProcess();

            // Make sure that the pipeline will direct all preprocessed
            // SAX events to the new event recorder
            target.addHeadProcess(process);

            // This will cause the original event recorder to send the
            // original SAX events to the target pipeline which will
            // then preprocess them (we assume) and send them to the
            // event collection process
            try {
                PipelinePlayer player = recording.createPlayer();
                player.play(target.getPipelineProcess());
                recording = processedEventRecorder.stopRecording();
            } finally {
                // Must always remove the collection process so that the
                // pipeline isn't messed up
                target.removeHeadProcess();
            }

            evaluationMode = EvaluationMode.IMMEDIATE;
        }

        // Verify that the event recorder contains compatible markup
        if (complexity != Complexity.COMPLEX) {
            if (evaluationMode == EvaluationMode.REPEATED) {
                // Add a process that will only allow characters and ignorable
                // whitespace events through to perform the complexity testing
                addComplexityChecker(target, parameter);
            } else if (recording.isComplex()) {
                throw new XMLPipelineException("The " + parameter +
                        " value's type is simple but complex markup " +
                        "has been found", null);
            }
        }

        try {
            // Add the dependency information for this value to the pipeline.
            DependencyContext dependencyContext =
                    context.getDependencyContext();
            dependencyContext.addDependency(dependency);

            XMLProcess process;

            // Select the process to which the content should be sent based
            // on whether it needs to be processed through the dynamic pipeline
            // or not.
            if (evaluationMode == EvaluationMode.REPEATED) {
View Full Code Here

    private void addComplexityChecker(
            XMLPipeline target, final String parameter)
            throws SAXException {

        // @todo could have standard process that does this
        XMLProcess process =
                new AbstractOperationProcess() {
                    // javadoc inherited
                    public void setDocumentLocator(Locator locator) {
                        super.setDocumentLocator(locator);
                    }
View Full Code Here

    // javadoc inherited
    public void endElement(DynamicProcess dynamicProcess,
                           ExpandedName element,
                           Object object)
            throws SAXException {
        XMLProcess process = (XMLProcess)object;
        // Remove the process that was added via the startElement
        // method of this rule.
        if (null != process) {
            // This checks that the correct process was removed
            dynamicProcess.removeProcess(process);
View Full Code Here

        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);
View Full Code Here

        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);
View Full Code Here

        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);
View Full Code Here

                                    ProcessResponseTestCommand comm)
            throws Exception {
        HTTPRequestOperationProcess process = (HTTPRequestOperationProcess)
                createTestableProcess();
        SAXHandler handler = new SAXHandler();
        XMLProcess consumer = XMLHelpers.createSAXHandlerProcess(handler);

        WebDriverAccessor accessor = createWebDriverAccessor(
                new WebDriverRequestImpl(), new WebDriverResponseImpl());
        XMLPipelineContext context = process.getPipelineContext();
        context.setProperty(WebDriverAccessor.class, accessor, false);
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.XMLProcess

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.