Package org.teiid.query.processor.xml

Examples of org.teiid.query.processor.xml.Program


   
    public void start(MappingChoiceNode choice, Map context){       
        IfInstruction ifInst = new IfInstruction();       
        // if an exception should be thrown as the default choice, then add a sub program to that
        if (choice.throwExceptionOnDefault()) {
            Program subProgram = new Program();
            subProgram.addInstruction(new AbortProcessingInstruction());
            DefaultCondition defCondition = new DefaultCondition(subProgram);
            ifInst.setDefaultCondition(defCondition);           
        }
       
        // to be used by the criteria nodes.
        context.put(choice, ifInst);       

        // process the node as others (if see we have not done anything for this node yet..)
        commonStart(choice, context);

        Program currentProgram = (Program)this.programStack.peek();       
        currentProgram.addInstruction(ifInst);       
    }
View Full Code Here


    }
   
    public void start(MappingCriteriaNode node, Map context){

        // every criteria node has its own program..
        Program childProgram = new Program();
        IfInstruction ifInst = (IfInstruction)context.get(node.getParentNode());
       
        if (node.getCriteria() != null) {
            Condition condition = new CriteriaCondition(node.getCriteriaNode(), childProgram);
            ifInst.addCondition(condition);           
View Full Code Here

    public void end(MappingSequenceNode sequence, Map context){  
        commonEnd(sequence, context);
    }   
   
    private void startRootRecursive(MappingBaseNode node, Map context) {
        Program childProgram = new Program();
        context.put(node.getRecursionId(), childProgram);
        this.programStack.push(childProgram);       
    }
View Full Code Here

        this.programStack.push(childProgram);       
    }

    private void endRootRecursive(MappingBaseNode node, Map context) {
        // add the recursive program to the main program.
        Program recursiveProgram = (Program)programStack.pop();
       
        // this is the main program
        Program currentProgram = (Program)this.programStack.peek();
        currentProgram.addInstructions(recursiveProgram);
        context.remove(node.getRecursionId());
       
        // defect 17575; In case of recursive node the top most element
        // name could be different from original; so take it it out, so that
        // recursive node can put what ever it needs as head.
View Full Code Here

        }        
    }
   
    public void start(MappingElement element, Map context){
        //commonStart(element, context);
        Program currentProgram = (Program)programStack.peek();
       
        // if we are dealing with multiple documents
        startFragment(currentProgram, element);
       
        ProcessorInstruction tagInst = TagBuilderVisitor.buildTag(element);
        currentProgram.addInstruction(tagInst);
       
        commonStart(element, context);
       
        // If there are more children under this node move the cursor down
        if (!element.getChildren().isEmpty()) {
            // update the program pointer
            currentProgram = (Program)programStack.peek();
            currentProgram.addInstruction(new MoveDocInstruction(MoveDocInstruction.DOWN));
        }
    }
View Full Code Here

            currentProgram.addInstruction(new MoveDocInstruction(MoveDocInstruction.DOWN));
        }
    }

    public void end(MappingElement element, Map context){
        Program currentProgram = (Program)this.programStack.peek();
       
        // If there were more children under this node move the cursor up       
        if (!element.getChildren().isEmpty()) {
            currentProgram.addInstruction(new MoveDocInstruction(MoveDocInstruction.UP));
        }
       
        commonEnd(element, context);
       
        // update the program pointer
View Full Code Here

        getProgramStats(program, map);
        return map;
    }

    private static Map getProgramStats(Program program, Map map) {
        Program childProgram = null;
       
        if (program == null) {
            return map;
        }
       
View Full Code Here

       
        ProcessorInstruction i20 = new EndDocumentInstruction();
       
        // Stitch them together
       
        Program program = new Program();
        program.addInstruction(i0);
        program.addInstruction(i1);
        program.addInstruction(i2);
        program.addInstruction(i3);
        program.addInstruction(i4);
        program.addInstruction(i5);
        program.addInstruction(i6);
        program.addInstruction(i7);
        program.addInstruction(i8);
        program.addInstruction(i9);

        Program subProgram = new Program();
        i9.setBlockProgram(subProgram);
        subProgram.addInstruction(i10);
        subProgram.addInstruction(i11);
        subProgram.addInstruction(i12);
        subProgram.addInstruction(i13);
        subProgram.addInstruction(i14);
        subProgram.addInstruction(i15);
        subProgram.addInstruction(i16);

        program.addInstruction(i17);
        program.addInstruction(i18);
        program.addInstruction(i19);
        program.addInstruction(i20);
View Full Code Here

        ProcessorInstruction i21 = new EndDocumentInstruction();

       
        // Stitch them together

        Program program = new Program();
        program.addInstruction(i0);
        program.addInstruction(i1);
        program.addInstruction(i2);
        program.addInstruction(i3);
        program.addInstruction(i4);
        program.addInstruction(i5);
        program.addInstruction(i6);
        program.addInstruction(i7);
        program.addInstruction(i8);
        program.addInstruction(i9);

        Program whileProgram = new Program();
        i9.setBlockProgram(whileProgram);
        whileProgram.addInstruction(i10);

        Program thenProgram = new Program();
        Condition cond = new CriteriaCondition(crit, thenProgram);
        i10.addCondition(cond);

        thenProgram.addInstruction(i11);
        thenProgram.addInstruction(i12);
        thenProgram.addInstruction(i13);
        thenProgram.addInstruction(i14);
        thenProgram.addInstruction(i15);
        thenProgram.addInstruction(i16);

        whileProgram.addInstruction(i17);

        program.addInstruction(i18);
        program.addInstruction(i19);
View Full Code Here

    public void testProcess1() throws Exception {
        FakeMetadataFacade metadata = exampleMetadata();
        String resultSetName = "xmltest.rs"; //$NON-NLS-1$
       
        FakeXMLProcessorEnvironment env = new FakeXMLProcessorEnvironment();
        Program program = exampleProgram(metadata, env);
       
        BufferManager bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
        XMLPlan temp = new XMLPlan(env);
        CommandContext context = new CommandContext("pid", null, null, null, 1); //$NON-NLS-1$
        temp.initialize(context,null,bufferMgr);
View Full Code Here

TOP

Related Classes of org.teiid.query.processor.xml.Program

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.