Package com.dtrules.xmlparser

Examples of com.dtrules.xmlparser.XMLPrinter


        return true;
    }
   
    public void generateMapping(String mapping, String inputfile, String outputfile) throws Exception {
        FileInputStream input = new FileInputStream(inputfile);
        XMLPrinter      out   = new XMLPrinter(new FileOutputStream(outputfile));
        generateMapping(mapping,input,out);
    }
View Full Code Here


    /* (non-Javadoc)
     * @see com.dtrules.mapping.IMapGenerator#generateMapping(java.lang.String, java.lang.String, java.lang.String)
     */
    public void generateMapping(String mapping, String inputfile, String outputfile) throws Exception {
        FileInputStream input = new FileInputStream(inputfile);
        XMLPrinter      out   = new XMLPrinter(new FileOutputStream(outputfile));
        generateMapping(mapping,input,out);
    }
View Full Code Here

     * Set the output streams for debug and trace.
     */
    public void setOutput(OutputStream debugtrace, OutputStream error) {
        if (debugtrace != null) {
            outPs = new PrintStream(debugtrace);
            out = new XMLPrinter(outPs);
        }
        err = new PrintStream(error);
    }
View Full Code Here

    /**
     * Set the output streams for debug and trace.
     */
    public void setOutput(PrintStream debugtrace, PrintStream error) {
        outPs = debugtrace;
        out = new XMLPrinter(outPs);
        err = error;
    }
View Full Code Here

    }

    @Override
    public void printReport(int runNumber, IRSession session, PrintStream out) throws Exception {
        XMLPrinter xout = new XMLPrinter(out);
        xout.opentag("result");
        session.printEntityReport(xout, false, false, session.getState(), "access", session.getState().find("access"));
        session.printEntityReport(xout, false, false, session.getState(), "note", session.getState().find("customer")
                .rEntityValue().get("notes"));
        xout.closetag();
    }
View Full Code Here

     
      }
     
      @Override
      public void printReport(int runNumber, IRSession session, PrintStream out) throws Exception {
          XMLPrinter xout = new XMLPrinter(out);
          xout.opentag("result");
          session.printEntityReport(
                  xout,
                  false,
                  false,
                  session.getState(),
                  "access",
                  session.getState().find("access"));
          session.printEntityReport(
                    xout,
                    false,
                    false,
                    session.getState(),
                    "note",
                    session.getState().find("customer").rEntityValue().get("notes"));
            xout.closetag();
      }
View Full Code Here

    }
     
      @Override
      public void printReport(int runNumber, IRSession session, PrintStream out) throws Exception {
          XMLPrinter xout = new XMLPrinter(out);
          xout.opentag("result");
          session.printEntityReport(
                  xout,
                  false,
                  false,
                  session.getState(),
                  "access",
                  session.getState().find("access"));
          session.printEntityReport(
                    xout,
                    false,
                    false,
                    session.getState(),
                    "note",
                    session.getState().find("customer").rEntityValue().get("notes"));
            xout.closetag();
      }
View Full Code Here

        currentFile = f.getName();
        GenericXMLParser.load(new FileInputStream(f),new TraceLoad());
    }
   
    public void printReport(PrintStream o){
        XMLPrinter xout = new XMLPrinter(o);
        xout.opentag("coverage");
       
        xout.opentag("minimum_files_for_coverage");
        for(String file : minFilesNeeded){
            xout.printdata("trace_file",file);
        }
        xout.closetag();
       
        xout.opentag("trace_files");
        for(String file : traceFilesProcessed){
            xout.printdata("trace_file",file);
        }
        xout.closetag();
       
       
        Object keys[] = tables.keySet().toArray();
       
        for(int i=0;i<keys.length-1;i++){
            for(int j=0;j<keys.length-1-i;j++){
                if(keys[j].toString().compareTo(keys[j+1].toString())>0){
                    Object hld = keys[j];
                    keys[j]    = keys[j+1];
                    keys[j+1= hld;
                }
            }
        }
       
        xout.opentag("tables");
        for(Object key : keys){
            Stats stats = tables.get(key);
            int total_columns = 0;
            int columns_covered = 0;
            if(stats.table.getHasNullColumn()){
               total_columns ++;
            }
            if(stats.noColumns>0){
                columns_covered++;
            }
            for(int i=0; i< stats.columnCount; i++){
                if(stats.table.getColumnsSpecified()[i]){
                    total_columns++;
                    if( stats.columnHits[i]>0){
                        columns_covered++;
                    }
                }
            }
        
            double fpercent = ((double) columns_covered / total_columns)*100.0;
            int    percent  = (int) fpercent;
            int    fraction = (int) ((fpercent - percent)*100);
           
            xout.opentag("table","name",key,"count_of_calls",stats.calledCount, "percent_covered",percent+"."+fraction);
           
            if(stats.table.getHasNullColumn()){
                xout.printdata("column","n","none","hits",stats.noColumns,null);
            }
           
            for(int i=0; i< stats.columnCount; i++){
                if(stats.table.getColumnsSpecified()[i]){
                    xout.printdata("column","n",i+1,"hits",stats.columnHits[i],null);
                }
            }
            xout.closetag();
        }
        xout.closetag();
        xout.closetag();
    }
View Full Code Here

      int lines = inc*10;
     
      for(int i=1;i<=numCases; i++){
        if(i>0 && i%inc   ==0 )ostream.print(i+" ");
        if(i>0 && i%lines ==0 )ostream.print("\n");
        xout = new XMLPrinter("chip_case",new FileOutputStream(filename(name,numCases,i)));
        generate();
        xout.close();
      }
    } catch (FileNotFoundException e) {
      ostream.println(e.toString());
View Full Code Here

        t.writeDecisionTables("Chip", null, true, 10);
    }
   
    @Override
    public void printReport(int runNumber, IRSession session, PrintStream out) throws Exception {
        XMLPrinter xout = new XMLPrinter(out);
        session.printEntityReport(
                xout,
                false,
                false,
                session.getState(),
View Full Code Here

TOP

Related Classes of com.dtrules.xmlparser.XMLPrinter

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.