Package org.apache.maven.doxia.sink

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


        assertEquals( it, "anchor", "anchor_" );

        SinkEventElement next = it.next();
        assertEquals( "section1", next.getName() );
        SinkEventAttributeSet set = (SinkEventAttributeSet) next.getArgs()[0];
        assertEquals( 3, set.getAttributeCount() );
        assertTrue( set.containsAttribute( "name", "section name" ) );
        assertTrue( set.containsAttribute( "class", "foo" ) );
        assertTrue( set.containsAttribute( "id", "bar" ) );

        next = it.next();
        assertEquals( "sectionTitle1", next.getName() );
        assertNull( (SinkEventAttributeSet) next.getArgs()[0] );
View Full Code Here


        if ( count < 0 )
        {
            return null;
        }

        SinkEventAttributeSet atts = new SinkEventAttributeSet( count );

        for ( int i = 0; i < count; i++ )
        {
            atts.addAttribute( parser.getAttributeName( i ), parser.getAttributeValue( i ) );
        }

        return atts;
    }
View Full Code Here

     */
    protected void handleUnknown( XmlPullParser parser, Sink sink, int type )
    {
        Object[] required = new Object[] { Integer.valueOf( type ) };

        SinkEventAttributeSet attribs = getAttributesFromParser( parser );

        sink.unknown( parser.getName(), required, attribs );
    }
View Full Code Here

        if ( img == null )
        {
            return null;
        }

        MutableAttributeSet atts = new SinkEventAttributeSet();
        atts.addAttribute( SinkEventAttributeSet.WIDTH, Integer.toString( img.getWidth() ) );
        atts.addAttribute( SinkEventAttributeSet.HEIGHT, Integer.toString( img.getHeight() ) );
        // add other attributes?

        return atts;
    }
View Full Code Here

        if ( count <= 0 )
        {
            return null;
        }

        final SinkEventAttributeSet atts = new SinkEventAttributeSet( count );

        for ( Map.Entry<?, ?> entry : parameters.entrySet() )
        {
            atts.addAttribute( entry.getKey(), entry.getValue() );
        }

        return atts;
    }
View Full Code Here

     */
    protected boolean baseStartTag( XmlPullParser parser, Sink sink )
    {
        boolean visited = true;

        SinkEventAttributeSet attribs = getAttributesFromParser( parser );

        if ( parser.getName().equals( HtmlMarkup.H2.toString() ) )
        {
            handleSectionStart( sink, Sink.SECTION_LEVEL_1, attribs );
        }
View Full Code Here

        String divclass = parser.getAttributeValue( null, Attribute.CLASS.toString() );

        if ( "figure".equals( divclass ) )
        {
            this.inFigure = true;
            SinkEventAttributeSet atts = new SinkEventAttributeSet( attribs );
            atts.removeAttribute( SinkEventAttributes.CLASS );
            sink.figure( atts );
        }
        else
        {
            visited = false;
View Full Code Here

    }

    /** {@inheritDoc} */
    public void tableCell( String width )
    {
        SinkEventAttributeSet att = new SinkEventAttributeSet();
        att.addAttribute( javax.swing.text.html.HTML.Attribute.WIDTH, width );

        tableCell( att );
    }
View Full Code Here

    }

    /** {@inheritDoc} */
    public void tableHeaderCell( String width )
    {
        SinkEventAttributeSet att = new SinkEventAttributeSet();
        att.addAttribute( javax.swing.text.html.HTML.Attribute.WIDTH, width );

        tableHeaderCell( att );
    }
View Full Code Here

    createParser().parse(new StringReader(document), sink);

    Iterator<SinkEventElement> it = sink.getEventList().iterator();
    assertEquals(it, "head", "head_", "body", "paragraph");
    assertEquals(it.next(), "text", "Linethrough",
        new SinkEventAttributeSet("decoration", "line-through"));
    assertEquals(it, "paragraph_", "body_");
    assertFalse(it.hasNext());
  }
View Full Code Here

TOP

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

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.