Examples of ByLineReaderSource


Examples of org.apache.maven.doxia.util.ByLineReaderSource

    /** {@inheritDoc} */
    public synchronized void parse( Reader source, Sink sink )
        throws ParseException
    {
        ByLineSource src = new ByLineReaderSource( source );

        try
        {
            List<Block> blocks = parse( src );

            sink.head();

            sink.head_();

            sink.body();

            for ( Block block : blocks )
            {
                block.traverse( sink );
            }

            sink.body_();
        }
        catch ( Exception e )
        {
            // TODO handle column number
            throw new ParseException( e, src.getName(), src.getLineNumber(), -1 );
        }
        finally
        {
            setSecondParsing( false );
            init();
View Full Code Here

Examples of org.apache.maven.doxia.util.ByLineReaderSource

        throws ParseException
    {
        init();

        List<Block> blocks;
        final ByLineSource src = new ByLineReaderSource( source );

        try
        {
            blocks = parse( src );
        }
        catch ( final Exception e )
        {
            // TODO handle column number
            throw new ParseException( e, src.getName(), src.getLineNumber(), -1 );
        }

        sink.head();

        final String title = getTitle( blocks, src );
View Full Code Here

Examples of org.apache.maven.doxia.util.ByLineReaderSource

                for ( int i = 0; i < text.length; i++ )
                {
                    List<Block> textBlocks = new ArrayList<Block>();

                    textBlocks.add( ( ( ParagraphBlockParser) paragraphParser )
                            .visit( text[i], new ByLineReaderSource( new StringReader( EMPTY_STRING ) ), false ) );

                    List<Block> blocks = new ArrayList<Block>();

                    blocks.add( new BoldBlock( textBlocks ) );

                    cells.add( new TableCellHeaderBlock( blocks ) );
                }
            }
            else
            {
                int it = 0;
                String[] text = StringUtils.split( l, "|" );
                List<String> texts = new LinkedList<String>();


                while ( it < text.length )
                {
                    if ( text[it].matches( ANY_CHARACTER + ESCAPE_CHARACTER
                                + ConfluenceMarkup.LINK_START_MARKUP + ANY_CHARACTER )
                            && !text[it].matches( ANY_CHARACTER + ESCAPE_CHARACTER
                                + ConfluenceMarkup.LINK_END_MARKUP + ANY_CHARACTER ) )
                    {
                        texts.add( text[it] + ConfluenceMarkup.TABLE_CELL_MARKUP + text[it + 1] );
                        it += 2;
                        continue;
                     }
                    texts.add( text[it] );
                    it++;
                }

                Object[] pText = texts.toArray();
                for ( int i = 0; i < pText.length; i++ )
                {
                    List<Block> blocks = new ArrayList<Block>();

                    blocks.add( ( (ParagraphBlockParser) paragraphParser ).visit( (String) pText[i],
                            new ByLineReaderSource( new StringReader( EMPTY_STRING ) ), false ) );

                    cells.add( new TableCellBlock( blocks ) );
                }
            }
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.