Package org.apache.maven.doxia.sink

Examples of org.apache.maven.doxia.sink.Sink


    public void parse(Reader input, Writer output) throws IOException, SlingAptParseException {
        parse(input, output, null);
    }

    public void parse(Reader input, Writer output, Map<String, Object> options) throws IOException, SlingAptParseException {
        final Sink sink = new CustomAptSink(output, options);
        final AptParser parser = new CustomAptParser(macroProvider);
        try {
            parser.parse(input, sink);
        } catch(AptParseException ape) {
            throw new SlingAptParseExceptionImpl(ape);
View Full Code Here


            catch ( ComponentLookupException e )
            {
                throw new ConverterException( "ComponentLookupException: " + e.getMessage(), e );
            }

            Sink sink;
            try
            {
                sink = sinkFactory.createSink( output.getOutputStream(), output.getEncoding() );
            }
            catch ( IOException e )
            {
                throw new ConverterException( "IOException: " + e.getMessage(), e );
            }
            sink.enableLogging( log );

            if ( getLog().isDebugEnabled() )
            {
                getLog().debug( "Sink used: " + sink.getClass().getName() );
            }

            parse( parser, input.getReader(), sink );
        }
        finally
View Full Code Here

        catch ( ComponentLookupException e )
        {
            throw new ConverterException( "ComponentLookupException: " + e.getMessage(), e );
        }

        Sink sink;
        try
        {
            String outputEncoding;
            if ( StringUtils.isEmpty( output.getEncoding() )
                || output.getEncoding().equals( OutputFileWrapper.AUTO_ENCODING ) )
            {
                outputEncoding = inputEncoding;
            }
            else
            {
                outputEncoding = output.getEncoding();
            }

            OutputStream out = new FileOutputStream( outputFile );
            sink = sinkFactory.createSink( out, outputEncoding );
        }
        catch ( IOException e )
        {
            throw new ConverterException( "IOException: " + e.getMessage(), e );
        }

        sink.enableLogging( log );

        if ( getLog().isDebugEnabled() )
        {
            getLog().debug( "Sink used: " + sink.getClass().getName() );
        }

        parse( parser, reader, sink );

        if ( formatOutput && ( output.getFormat().equals( DOCBOOK_SINK ) || output.getFormat().equals( FO_SINK )
View Full Code Here

    protected void executeReport(final Locale locale) throws MavenReportException {
        try {
            this.execute(this.outputDirectory, locale);

            Sink kitchenSink = getSink();
            if (kitchenSink != null) {
                kitchenSink.rawText(indexHtmlContent);
            } else {
                writeIndexHtmlFile(outputDirectory, "index.html", indexHtmlContent);
            }
        } catch (Exception e) {
            final MavenReportException ex = new MavenReportException(e.getMessage());
View Full Code Here

    protected void executeReport(final Locale locale) throws MavenReportException {
        try {
            this.execute(this.outputDirectory, locale);

            Sink kitchenSink = getSink();
            if (kitchenSink != null) {
                kitchenSink.rawText(indexHtmlContent);
            } else {
                writeIndexHtmlFile(outputDirectory, "index.html", indexHtmlContent);
            }
        } catch (Exception e) {
            final MavenReportException ex = new MavenReportException(e.getMessage());
View Full Code Here

        try {
      String[] reports = this.reportsDir.list(HtmlFilter.INSTANCE);
      //boolean styleDone = false;
       
      ResourceBundle bundle = getBundle( locale );
      Sink sink = this.getSink();
            sinkBeginReport(sink, bundle);
            sink.sectionTitle1();
          sink.text( bundle.getString( "report.fitnesse.name" ) );
          sink.sectionTitle1_();
      for(String report : reports) {
                //String html = html(report);
                Document document = Jsoup.parse(new File(this.reportsDir, report), null);
                Elements tables = document.getElementsByTag("table");
                // Is it a top-level index page?
                if(tables.size() == 1 &&
                    testTdElements(tables.get(0).getElementsByTag("td"), "name", "right", "wrong", "exceptions")) {
                     
                  Elements hrefs = document.getElementsByTag("a");
                  for(Element href : hrefs) {
                    String extant = href.attr("href");
                    href.attr("href", OUTPUT_NAME + "." + extant);
                  }
                    sink.rawText(document.html());
          /*
                  if(!styleDone) {
                        addElements(sink, document.head().getElementsByTag("link"));
                        addElements(sink, document.head().getElementsByTag("script"));
                        styleDone = true;
View Full Code Here

    }
  }
 
  private void createReport(String reportName, Locale locale, Document document) {
        SinkFactory factory = getSinkFactory();
        Sink sink = factory.createSink(getReportOutputDirectory(), reportName);
        sinkBeginReport(sink, getBundle( locale ));
        sink.rawText(document.html());
        //addElements(sink, document.head().getElementsByTag("link"));
    //addElements(sink, document.head().getElementsByTag("script"));
    //addElements(sink, document.body().children());
        sinkEndReport(sink);
        sink.close();
  }
View Full Code Here

        try
        {
            output = getTestWriter( "macro" );
            reader = getTestReader( "macro" );

            Sink sink = new XhtmlBaseSink( output );
            createParser().parse( reader, sink );
            sink.close();
        }
        finally
        {
            IOUtil.close( output );
            IOUtil.close( reader );
View Full Code Here

        try
        {
            output = getTestWriter( "macro" );
            reader = getTestReader( "macro" );

            Sink sink = new XdocSink( output );
            createParser().parse( reader, sink );
            sink.close();
        }
        finally
        {
            IOUtil.close( output );
            IOUtil.close( reader );
View Full Code Here

        try
        {
            output = getTestWriter( "toc" );
            reader = getTestReader( "toc" );

            Sink sink = new XdocSink( output );
            createParser().parse( reader, sink );
            sink.close();
        }
        finally
        {
            IOUtil.close( output );
            IOUtil.close( reader );
View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.sink.Sink

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.