Author: ltheussl
Date: Tue May 12 13:10:14 2009
New Revision: 773879
URL: http://svn.apache.org/viewvc?rev=773879&view=rev
Log:
Re-use some code snippets
Modified:
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
Modified:
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
URL:
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java?rev=773879&r1=773878&r2=773879&view=diff
==============================================================================
---
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
(original)
+++
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
Tue May 12 13:10:14 2009
@@ -508,15 +508,7 @@
*/
public void list()
{
- if ( paragraphFlag )
- {
- // The content of element type "p" must match
- //
"(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
- //
dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
- paragraph_();
- }
-
- writeStartTag( Tag.UL );
+ list( null );
}
/**
@@ -525,6 +517,14 @@
*/
public void list( SinkEventAttributes attributes )
{
+ if ( paragraphFlag )
+ {
+ // The content of element type "p" must match
+ //
"(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
+ //
dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
+ paragraph_();
+ }
+
MutableAttributeSet atts = SinkUtils.filterAttributes(
attributes, SinkUtils.SINK_BASE_ATTRIBUTES );
@@ -546,7 +546,7 @@
*/
public void listItem()
{
- writeStartTag( Tag.LI );
+ listItem( null );
}
/**
@@ -645,7 +645,7 @@
*/
public void numberedListItem()
{
- writeStartTag( Tag.LI );
+ numberedListItem( null );
}
/**
@@ -675,15 +675,7 @@
*/
public void definitionList()
{
- if ( paragraphFlag )
- {
- // The content of element type "p" must match
- //
"(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
- //
dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
- paragraph_();
- }
-
- writeStartTag( Tag.DL );
+ definitionList( null );
}
/**
@@ -733,7 +725,7 @@
*/
public void definedTerm()
{
- writeStartTag( Tag.DT );
+ definedTerm( null );
}
/**
@@ -751,7 +743,7 @@
*/
public void definition()
{
- writeStartTag( Tag.DD );
+ definition( null );
}
/**
@@ -930,9 +922,7 @@
*/
public void paragraph()
{
- paragraphFlag = true;
-
- writeStartTag( Tag.P );
+ paragraph( null );
}
/**
@@ -971,23 +961,14 @@
*/
public void verbatim( boolean boxed )
{
- if ( paragraphFlag )
+ if ( boxed )
{
- // The content of element type "p" must match
- //
"(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
- //
dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
- paragraph_();
+ verbatim( SinkEventAttributeSet.BOXED );
}
-
- SinkEventAttributeSet att = null;
-
- if ( boxed )
+ else
{
- att = new SinkEventAttributeSet();
- att.addAttribute( SinkEventAttributes.DECORATION, "boxed" );
+ verbatim( null );
}
-
- verbatim( att );
}
/**
@@ -1068,7 +1049,7 @@
*/
public void horizontalRule()
{
- writeSimpleTag( Tag.HR );
+ horizontalRule( null );
}
/**
@@ -1086,14 +1067,6 @@
/** {...@inheritdoc} */
public void table()
{
- if ( paragraphFlag )
- {
- // The content of element type "p" must match
- //
"(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
- //
dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
- paragraph_();
- }
-
// start table with tableRows
table( null );
}
@@ -1291,13 +1264,13 @@
/** {...@inheritdoc} */
public void tableCell()
{
- tableCell( false, null );
+ tableCell( (SinkEventAttributeSet) null );
}
/** {...@inheritdoc} */
public void tableHeaderCell()
{
- tableCell( true, null );
+ tableHeaderCell( (SinkEventAttributeSet) null );
}
/** {...@inheritdoc} */
@@ -1494,7 +1467,7 @@
/** {...@inheritdoc} */
public void link( String name )
{
- link( name, null, null );
+ link( name, null );
}
/** {...@inheritdoc} */
@@ -1650,14 +1623,7 @@
*/
public void lineBreak()
{
- if ( headFlag || isVerbatimFlag() )
- {
- getTextBuffer().append( EOL );
- }
- else
- {
- writeSimpleTag( Tag.BR );
- }
+ lineBreak( null );
}
/**
@@ -1666,7 +1632,7 @@
*/
public void lineBreak( SinkEventAttributes attributes )
{
- if ( headFlag )
+ if ( headFlag || isVerbatimFlag() )
{
getTextBuffer().append( EOL );
}