You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by lt...@apache.org on 2008/03/12 13:47:08 UTC
svn commit: r636301 - in /maven/doxia/doxia/trunk:
doxia-core/src/main/java/org/apache/maven/doxia/parser/
doxia-core/src/main/java/org/apache/maven/doxia/sink/
doxia-core/src/test/java/org/apache/maven/doxia/sink/
doxia-modules/doxia-module-xdoc/src/m...
Author: ltheussl
Date: Wed Mar 12 05:47:04 2008
New Revision: 636301
URL: http://svn.apache.org/viewvc?rev=636301&view=rev
Log:
Use DECORATION=boxed instead of BOXED=true/false
Modified:
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkUtils.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java
maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java
maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java?rev=636301&r1=636300&r2=636301&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java Wed Mar 12 05:47:04 2008
@@ -183,7 +183,7 @@
{
verbatim();
- attribs.addAttribute( SinkEventAttributeSet.BOXED, "false");
+ attribs.removeAttribute( SinkEventAttributeSet.DECORATION );
sink.verbatim( attribs );
}
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkUtils.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkUtils.java?rev=636301&r1=636300&r2=636301&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkUtils.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkUtils.java Wed Mar 12 05:47:04 2008
@@ -144,7 +144,7 @@
join( SINK_BASE_ATTRIBUTES, new String[] {SinkEventAttributes.ALIGN} );
SINK_VERBATIM_ATTRIBUTES =
join( SINK_BASE_ATTRIBUTES,
- new String[] {SinkEventAttributes.ALIGN, SinkEventAttributes.BOXED, SinkEventAttributes.WIDTH} );
+ new String[] {SinkEventAttributes.ALIGN, SinkEventAttributes.DECORATION, SinkEventAttributes.WIDTH} );
SINK_HR_ATTRIBUTES = join( SINK_BASE_ATTRIBUTES, HR_ATTRIBUTES );
SINK_LINK_ATTRIBUTES = join( SINK_BASE_ATTRIBUTES, LINK_ATTRIBUTES );
SINK_TABLE_ATTRIBUTES = join( SINK_BASE_ATTRIBUTES, TABLE_ATTRIBUTES );
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=636301&r1=636300&r2=636301&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 Wed Mar 12 05:47:04 2008
@@ -883,7 +883,11 @@
public void verbatim( boolean boxed )
{
SinkEventAttributeSet att = new SinkEventAttributeSet();
- att.addAttribute( "boxed", Boolean.toString( boxed ) );
+
+ if ( boxed )
+ {
+ att.addAttribute( SinkEventAttributes.DECORATION, "boxed" );
+ }
verbatim( att );
}
@@ -909,10 +913,10 @@
boolean boxed = false;
- if ( atts.isDefined( "boxed" ) )
+ if ( atts.isDefined( SinkEventAttributes.DECORATION ) )
{
- boxed = Boolean.valueOf(
- (String) atts.getAttribute( "boxed" ) ).booleanValue();
+ boxed =
+ "boxed".equals( (String) atts.getAttribute( SinkEventAttributes.DECORATION ) );
}
if ( boxed )
@@ -920,7 +924,7 @@
atts.addAttribute( Attribute.CLASS, "source" );
}
- atts.removeAttribute( "boxed" );
+ atts.removeAttribute( SinkEventAttributes.DECORATION );
String width = (String) atts.getAttribute( Attribute.WIDTH.toString() );
atts.removeAttribute( Attribute.WIDTH.toString() );
Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java?rev=636301&r1=636300&r2=636301&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java Wed Mar 12 05:47:04 2008
@@ -757,10 +757,10 @@
{
boolean boxed = false;
- if ( attributes != null && attributes.isDefined( "boxed" ) )
+ if ( attributes != null && attributes.isDefined( SinkEventAttributes.DECORATION ) )
{
- boxed = Boolean.valueOf(
- (String) attributes.getAttribute( "boxed" ) ).booleanValue();
+ boxed = "boxed".equals(
+ (String) attributes.getAttribute( SinkEventAttributes.DECORATION ) );
}
verbatim( boxed );
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java?rev=636301&r1=636300&r2=636301&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java Wed Mar 12 05:47:04 2008
@@ -155,7 +155,7 @@
{
verbatim();
- attribs.addAttribute( "boxed", "true");
+ attribs.addAttribute( SinkEventAttributeSet.DECORATION, "boxed");
sink.verbatim( attribs );
}
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java?rev=636301&r1=636300&r2=636301&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java Wed Mar 12 05:47:04 2008
@@ -312,14 +312,14 @@
boolean boxed = false;
- if ( atts.isDefined( "boxed" ) )
+ if ( atts.isDefined( SinkEventAttributes.DECORATION ) )
{
- boxed = Boolean.valueOf(
- (String) atts.getAttribute( "boxed" ) ).booleanValue();
+ boxed = "boxed".equals(
+ (String) atts.getAttribute( SinkEventAttributes.DECORATION ) );
}
boxedFlag = boxed;
- atts.removeAttribute( "boxed" );
+ atts.removeAttribute( SinkEventAttributes.DECORATION );
if ( boxed )
{
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java?rev=636301&r1=636300&r2=636301&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java Wed Mar 12 05:47:04 2008
@@ -125,7 +125,10 @@
*/
else if ( parser.getName().equals( Tag.PRE.toString() ) )
{
- attribs.addAttribute( "boxed", Boolean.toString( boxed ) );
+ if ( boxed )
+ {
+ attribs.addAttribute( SinkEventAttributeSet.DECORATION, "boxed" );
+ }
sink.verbatim( attribs );
}
Modified: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java?rev=636301&r1=636300&r2=636301&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java (original)
+++ maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java Wed Mar 12 05:47:04 2008
@@ -716,7 +716,8 @@
/**
* Starts a verbatim block, ie a block where whitespace has semantic relevance.
- * Supported attributes are the {@link SinkEventAttributes base attributes} plus: "boxed", ALIGN, WIDTH.
+ * Supported attributes are the {@link SinkEventAttributes base attributes} plus:
+ * DECORATION (value: "boxed"), ALIGN, WIDTH.
*
* @param attributes A set of {@link SinkEventAttributes}.
*/
Modified: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java?rev=636301&r1=636300&r2=636301&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java (original)
+++ maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java Wed Mar 12 05:47:04 2008
@@ -284,17 +284,10 @@
*/
String VALIGN = "valign";
- // verbatim
-
- /**
- * Whether to draw a border, or box around an element.
- */
- String BOXED = "boxed";
-
// text
/**
* Specifies a decoration for an element. Generally accepted values
- * are "underline", "overline", "line-through".
+ * are "underline", "overline", "line-through", "boxed".
*/
String DECORATION = "decoration";
}