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 hb...@apache.org on 2011/04/10 01:15:31 UTC
svn commit: r1090706 [1/3] - in /maven/doxia/doxia/trunk: ./ doxia-book/
doxia-book/src/main/java/org/apache/maven/doxia/book/
doxia-book/src/main/java/org/apache/maven/doxia/book/context/
doxia-book/src/main/java/org/apache/maven/doxia/book/services/i...
Author: hboutemy
Date: Sat Apr 9 23:15:28 2011
New Revision: 1090706
URL: http://svn.apache.org/viewvc?rev=1090706&view=rev
Log:
[DOXIA-422] upgraded to Java 5
Modified:
maven/doxia/doxia/trunk/doxia-book/pom.xml
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java
maven/doxia/doxia/trunk/doxia-core/pom.xml
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/MacroRequest.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/manager/DefaultMacroManager.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/DefaultSiteModuleManager.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/SiteModuleManager.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
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/parser/manager/DefaultParserManager.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/PipelineSink.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.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/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
maven/doxia/doxia/trunk/doxia-logging-api/pom.xml
maven/doxia/doxia/trunk/doxia-maven-plugin/pom.xml
maven/doxia/doxia/trunk/doxia-maven-plugin/src/main/java/org/apache/maven/doxia/plugin/Book.java
maven/doxia/doxia/trunk/doxia-maven-plugin/src/main/java/org/apache/maven/doxia/plugin/DoxiaRenderBooksMojo.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/AbstractFatherBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/BoldBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/DefinitionListBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ItalicBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/MonospaceBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/BulletedListBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListItemBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/NumberedListBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeListBuilder.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableCellHeaderBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableRowBlock.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/FontMetrics.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/pom.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/FormatedTextParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/GenericListBlockParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ParagraphBlockParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlockParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableBlockParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TextParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/VerbatimBlockParser.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/pom.xml
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-xhtml/pom.xml
maven/doxia/doxia/trunk/doxia-modules/pom.xml
maven/doxia/doxia/trunk/doxia-sink-api/pom.xml
maven/doxia/doxia/trunk/doxia-test-docs/pom.xml
maven/doxia/doxia/trunk/pom.xml
Modified: maven/doxia/doxia/trunk/doxia-book/pom.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/pom.xml?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/pom.xml (original)
+++ maven/doxia/doxia/trunk/doxia-book/pom.xml Sat Apr 9 23:15:28 2011
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia</artifactId>
- <version>1.1.5-SNAPSHOT</version>
+ <version>1.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/BookDoxia.java Sat Apr 9 23:15:28 2011
@@ -57,7 +57,7 @@ public interface BookDoxia
* @see #renderBook(BookModel, String, List, File, Locale, String, String)
* @see Locale#getDefault()
*/
- void renderBook( BookModel book, String bookRendererId, List files, File outputDirectory )
+ void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory )
throws BookDoxiaException;
/**
@@ -73,7 +73,7 @@ public interface BookDoxia
* @throws org.apache.maven.doxia.book.BookDoxiaException if the model cannot be loaded.
* @since 1.1
*/
- void renderBook( BookModel book, String bookRendererId, List files, File outputDirectory, Locale locale,
+ void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory, Locale locale,
String inputEncoding, String outputEncoding )
throws BookDoxiaException;
}
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java Sat Apr 9 23:15:28 2011
@@ -64,7 +64,7 @@ public class DefaultBookDoxia
/**
* @plexus.requirement role="org.apache.maven.doxia.book.services.renderer.BookRenderer"
*/
- private Map bookRenderers;
+ private Map<String, BookRenderer> bookRenderers;
// ----------------------------------------------------------------------
// BookDoxia Implementation
@@ -78,15 +78,15 @@ public class DefaultBookDoxia
}
/** {@inheritDoc} */
- public void renderBook( BookModel book, String bookRendererId, List files, File outputDirectory )
+ public void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory )
throws BookDoxiaException
{
renderBook( book, bookRendererId, files, outputDirectory, Locale.getDefault(), "UTF-8", "UTF-8" );
}
/** {@inheritDoc} */
- public void renderBook( BookModel book, String bookRendererId, List files, File outputDirectory, Locale locale,
- String inputEncoding, String outputEncoding )
+ public void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory,
+ Locale locale, String inputEncoding, String outputEncoding )
throws BookDoxiaException
{
// ----------------------------------------------------------------------
@@ -132,7 +132,7 @@ public class DefaultBookDoxia
// Render the book
// ----------------------------------------------------------------------
- BookRenderer bookRenderer = (BookRenderer) bookRenderers.get( bookRendererId );
+ BookRenderer bookRenderer = bookRenderers.get( bookRendererId );
if ( bookRenderer == null )
{
@@ -147,7 +147,7 @@ public class DefaultBookDoxia
*
* @return Set
*/
- public Set getAvailableBookRenderers()
+ public Set<String> getAvailableBookRenderers()
{
return Collections.unmodifiableSet( bookRenderers.keySet() );
}
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/context/BookContext.java Sat Apr 9 23:15:28 2011
@@ -38,7 +38,7 @@ public class BookContext
private BookModel book;
/** The files. */
- private Map files;
+ private Map<String, BookContext.BookFile> files;
/** The output directory. */
private File outputDirectory;
@@ -130,11 +130,11 @@ public class BookContext
*
* @return Map. A new HashMap is constructed if the current Map is null.
*/
- public Map getFiles()
+ public Map<String, BookContext.BookFile> getFiles()
{
if ( files == null )
{
- files = new HashMap();
+ files = new HashMap<String, BookContext.BookFile>();
}
return files;
@@ -145,7 +145,7 @@ public class BookContext
*
* @param files the Map of files.
*/
- public void setFiles( Map files )
+ public void setFiles( Map<String, BookContext.BookFile> files )
{
this.files = files;
}
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/indexer/DefaultBookIndexer.java Sat Apr 9 23:15:28 2011
@@ -21,7 +21,6 @@ package org.apache.maven.doxia.book.serv
import java.io.FileNotFoundException;
import java.io.FileReader;
-import java.util.Iterator;
import org.apache.maven.doxia.Doxia;
import org.apache.maven.doxia.book.BookDoxiaException;
@@ -63,10 +62,8 @@ public class DefaultBookIndexer
{
BookIndex index = new BookIndex();
- for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
+ for ( Chapter chapter : book.getChapters() )
{
- Chapter chapter = (Chapter) it.next();
-
indexChapter( bookContext, index, chapter );
}
@@ -92,10 +89,8 @@ public class DefaultBookIndexer
chapterEntry.setTitle( chapter.getTitle() );
- for ( Iterator it = chapter.getSections().iterator(); it.hasNext(); )
+ for ( Section section : chapter.getSections() )
{
- Section section = (Section) it.next();
-
indexSection( context, chapterEntry, section );
}
}
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/BookIo.java Sat Apr 9 23:15:28 2011
@@ -53,5 +53,5 @@ public interface BookIo
* @param context the BookContext.
* @param files a list of files.
*/
- void loadFiles( BookContext context, List files );
+ void loadFiles( BookContext context, List<File> files );
}
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/io/DefaultBookIo.java Sat Apr 9 23:15:28 2011
@@ -34,7 +34,6 @@ import java.io.IOException;
import java.io.File;
import java.io.Reader;
import java.util.Collection;
-import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import java.util.List;
@@ -84,28 +83,24 @@ public class DefaultBookIo
}
/** {@inheritDoc} */
- public void loadFiles( BookContext context, List files )
+ public void loadFiles( BookContext context, List<File> files )
{
// ----------------------------------------------------------------------
// Find all the files, map the file names to ids
// ----------------------------------------------------------------------
- Collection siteModules = siteModuleManager.getSiteModules();
+ Collection<SiteModule> siteModules = siteModuleManager.getSiteModules();
- for ( Iterator it = siteModules.iterator(); it.hasNext(); )
+ for ( SiteModule siteModule : siteModules )
{
- SiteModule siteModule = (SiteModule) it.next();
-
String extension = siteModule.getExtension();
String sourceDirectory = File.separator + siteModule.getSourceDirectory() + File.separator;
String parserId = siteModule.getParserId();
- for ( Iterator j = files.iterator(); j.hasNext(); )
+ for ( File file : files )
{
- File file = (File) j.next();
-
String name = file.getName();
String path = file.getAbsolutePath();
@@ -136,13 +131,11 @@ public class DefaultBookIo
{
getLogger().debug( "Dumping document <-> id mapping:" );
- Map map = new TreeMap( context.getFiles() );
+ Map<String, BookContext.BookFile> map = new TreeMap<String, BookContext.BookFile>( context.getFiles() );
- for ( Iterator it = map.entrySet().iterator(); it.hasNext(); )
+ for ( Map.Entry<String, BookContext.BookFile> entry : map.entrySet() )
{
- Map.Entry entry = (Map.Entry) it.next();
-
- BookContext.BookFile file = (BookContext.BookFile) entry.getValue();
+ BookContext.BookFile file = entry.getValue();
getLogger().debug( " " + entry.getKey() + "=" + file.getFile() + ", parser: " + file.getParserId() );
}
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/AbstractITextBookRenderer.java Sat Apr 9 23:15:28 2011
@@ -26,7 +26,6 @@ import java.io.Reader;
import java.io.Writer;
import java.text.DateFormat;
import java.util.Date;
-import java.util.Iterator;
import org.apache.maven.doxia.Doxia;
import org.apache.maven.doxia.book.BookDoxiaException;
@@ -139,10 +138,8 @@ public abstract class AbstractITextBookR
try
{
- for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
+ for ( Chapter chapter : book.getChapters() )
{
- Chapter chapter = (Chapter) it.next();
-
renderChapter( sink, writer, chapter, context );
}
@@ -213,10 +210,8 @@ public abstract class AbstractITextBookR
writer.endElement(); // title
// writer.startElement( "sectioncontent" );
- for ( Iterator it = chapter.getSections().iterator(); it.hasNext(); )
+ for ( Section section : chapter.getSections() )
{
- Section section = (Section) it.next();
-
renderSection( sink, writer, section, context );
}
// writer.endElement(); // sectioncontent
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/DocbookBookRenderer.java Sat Apr 9 23:15:28 2011
@@ -24,7 +24,6 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
-import java.util.Iterator;
import org.apache.maven.doxia.Doxia;
import org.apache.maven.doxia.book.BookDoxiaException;
@@ -126,10 +125,8 @@ public class DocbookBookRenderer
sink.bookHead_();
- for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
+ for ( Chapter chapter : book.getChapters() )
{
- Chapter chapter = (Chapter) it.next();
-
sink.chapter();
if ( StringUtils.isNotEmpty( chapter.getTitle() ) )
@@ -168,10 +165,8 @@ public class DocbookBookRenderer
private void renderChapter( Chapter chapter, BookContext context, Sink sink )
throws BookDoxiaException
{
- for ( Iterator it = chapter.getSections().iterator(); it.hasNext(); )
+ for ( Section section : chapter.getSections() )
{
- Section section = (Section) it.next();
-
renderSection( section, context, sink );
}
}
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java Sat Apr 9 23:15:28 2011
@@ -40,7 +40,6 @@ import java.io.PrintWriter;
import java.io.FileNotFoundException;
import java.io.Reader;
import java.io.Writer;
-import java.util.Iterator;
import java.util.Map;
import java.util.HashMap;
@@ -130,16 +129,12 @@ public class LatexBookRenderer
// Process all the section documents and collect their names
// ----------------------------------------------------------------------
- Map sectionInfos = new HashMap();
+ Map<String, SectionInfo> sectionInfos = new HashMap<String, SectionInfo>();
- for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
+ for ( Chapter chapter : book.getChapters() )
{
- Chapter chapter = (Chapter) it.next();
-
- for ( Iterator j = chapter.getSections().iterator(); j.hasNext(); )
+ for ( Section section : chapter.getSections() )
{
- Section section = (Section) j.next();
-
SectionInfo info = writeSection( section, context );
sectionInfos.put( info.id, info );
@@ -171,17 +166,13 @@ public class LatexBookRenderer
writer.println( "\\tableofcontents" );
// writer.println( "\\listoffigures" );
- for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
+ for ( Chapter chapter : book.getChapters() )
{
- Chapter chapter = (Chapter) it.next();
-
writer.println( "\\chapter{" + chapter.getTitle() + "}" );
- for ( Iterator j = chapter.getSections().iterator(); j.hasNext(); )
+ for ( Section section : chapter.getSections() )
{
- Section section = (Section) j.next();
-
- SectionInfo info = (SectionInfo) sectionInfos.get( section.getId() );
+ SectionInfo info = sectionInfos.get( section.getId() );
writer.println( "\\input{" + info.id + "}" );
}
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XHtmlBookRenderer.java Sat Apr 9 23:15:28 2011
@@ -39,7 +39,6 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
-import java.util.Iterator;
/**
* <p>XHtmlBookRenderer class.</p>
@@ -109,10 +108,8 @@ public class XHtmlBookRenderer
int chapterNumber = 1;
- for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
+ for ( Chapter chapter : book.getChapters() )
{
- Chapter chapter = (Chapter) it.next();
-
sink.sectionTitle();
sink.text( Integer.toString( chapterNumber ) + ". " + chapter.getTitle() );
sink.sectionTitle_();
@@ -149,10 +146,8 @@ public class XHtmlBookRenderer
private void renderChapter( XhtmlBookSink sink, Chapter chapter, BookContext context )
throws BookDoxiaException
{
- for ( Iterator it = chapter.getSections().iterator(); it.hasNext(); )
+ for ( Section section : chapter.getSections() )
{
- Section section = (Section) it.next();
-
renderSection( sink, section, context );
}
}
@@ -170,7 +165,7 @@ public class XHtmlBookRenderer
{
sink.section2();
- BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
+ BookContext.BookFile bookFile = context.getFiles().get( section.getId() );
if ( bookFile == null )
{
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/renderer/XdocBookRenderer.java Sat Apr 9 23:15:28 2011
@@ -147,13 +147,11 @@ public class XdocBookRenderer
// Render all the chapter pages
// -----------------------------------------------------------------------
- Iterator ii = context.getIndex().getChildEntries().iterator();
+ Iterator<IndexEntry> ii = context.getIndex().getChildEntries().iterator();
- for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
+ for ( Chapter chapter : book.getChapters() )
{
- Chapter chapter = (Chapter) it.next();
-
- renderChapter( chapter, context, (IndexEntry) ii.next() );
+ renderChapter( chapter, context, ii.next() );
}
}
@@ -198,9 +196,9 @@ public class XdocBookRenderer
sink.sectionTitle1_();
sink.list();
- for ( Iterator it = context.getIndex().getChildEntries().iterator(); it.hasNext(); )
+ for ( IndexEntry entry : context.getIndex().getChildEntries() )
{
- writeChapterIndexForBookIndex( sink, (IndexEntry) it.next() );
+ writeChapterIndexForBookIndex( sink, entry );
}
sink.list_();
@@ -232,9 +230,8 @@ public class XdocBookRenderer
sink.link_();
sink.list();
- for ( Iterator it = chapterEntry.getChildEntries().iterator(); it.hasNext(); )
+ for ( IndexEntry sectionIndex : chapterEntry.getChildEntries() )
{
- IndexEntry sectionIndex = (IndexEntry) it.next();
writeSectionIndexForBookIndex( sink, sectionIndex );
}
sink.list_();
@@ -256,9 +253,8 @@ public class XdocBookRenderer
sink.link_();
sink.list();
- for ( Iterator it = sectionIndex.getChildEntries().iterator(); it.hasNext(); )
+ for ( IndexEntry subsectionIndex : sectionIndex.getChildEntries() )
{
- IndexEntry subsectionIndex = (IndexEntry) it.next();
writeSubsectionIndexForBookIndex( sink, sectionIndex, subsectionIndex );
}
sink.list_();
@@ -317,13 +313,11 @@ public class XdocBookRenderer
// Render all section pages
// -----------------------------------------------------------------------
- Iterator ii = chapterIndex.getChildEntries().iterator();
+ Iterator<IndexEntry> ii = chapterIndex.getChildEntries().iterator();
- for ( Iterator it = chapter.getSections().iterator(); it.hasNext(); )
+ for ( Section section : chapter.getSections() )
{
- Section section = (Section) it.next();
-
- renderSection( context, section, (IndexEntry) ii.next() );
+ renderSection( context, section, ii.next() );
}
}
@@ -369,9 +363,8 @@ public class XdocBookRenderer
sink.sectionTitle1_();
sink.list();
- for ( Iterator it = chapterIndex.getChildEntries().iterator(); it.hasNext(); )
+ for ( IndexEntry sectionIndex : chapterIndex.getChildEntries() )
{
- IndexEntry sectionIndex = (IndexEntry) it.next();
writeSectionIndexForBookIndex( sink, sectionIndex );
}
sink.list_();
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java Sat Apr 9 23:15:28 2011
@@ -24,8 +24,6 @@ import org.codehaus.plexus.util.StringUt
import org.apache.maven.doxia.book.model.BookModel;
import org.apache.maven.doxia.book.model.Chapter;
-import java.util.Iterator;
-
/**
* Default implementation of BookValidator.
*
@@ -63,10 +61,8 @@ public class DefaultBookValidator
}
else
{
- for ( Iterator it = book.getChapters().iterator(); it.hasNext(); )
+ for ( Chapter chapter : book.getChapters() )
{
- Chapter chapter = (Chapter) it.next();
-
validateChapter( result, chapter );
// TODO: Validate the chapter id
Modified: maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java (original)
+++ maven/doxia/doxia/trunk/doxia-book/src/main/java/org/apache/maven/doxia/book/services/validation/ValidationResult.java Sat Apr 9 23:15:28 2011
@@ -30,14 +30,11 @@ import java.util.ArrayList;
*/
public class ValidationResult
{
- /** If all is OK. */
- private boolean allOk;
-
/** List of errors. */
- private List errors;
+ private List<String> errors;
/** List of warnings. */
- private List warnings;
+ private List<String> warnings;
/**
* Checks if there were any errors or warnings.
@@ -54,11 +51,11 @@ public class ValidationResult
*
* @return List. A new ArrayList is constructed if the current List is null.
*/
- public List getErrors()
+ public List<String> getErrors()
{
if ( errors == null )
{
- errors = new ArrayList();
+ errors = new ArrayList<String>();
}
return errors;
@@ -69,11 +66,11 @@ public class ValidationResult
*
* @return List. A new ArrayList is constructed if the current List is null.
*/
- public List getWarnings()
+ public List<String> getWarnings()
{
if ( warnings == null )
{
- warnings = new ArrayList();
+ warnings = new ArrayList<String>();
}
return warnings;
Modified: maven/doxia/doxia/trunk/doxia-core/pom.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/pom.xml?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/pom.xml (original)
+++ maven/doxia/doxia/trunk/doxia-core/pom.xml Sat Apr 9 23:15:28 2011
@@ -25,7 +25,7 @@ under the License.
<parent>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia</artifactId>
- <version>1.1.5-SNAPSHOT</version>
+ <version>1.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java Sat Apr 9 23:15:28 2011
@@ -21,7 +21,6 @@ package org.apache.maven.doxia.index;
import java.util.List;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.Collections;
import org.codehaus.plexus.util.StringUtils;
@@ -44,7 +43,7 @@ public class IndexEntry
private String title;
/** The child entries. */
- private List childEntries = new ArrayList();
+ private List<IndexEntry> childEntries = new ArrayList<IndexEntry>();
/** System-dependent EOL. */
private static final String EOL = System.getProperty( "line.separator" );
@@ -131,7 +130,7 @@ public class IndexEntry
*
* @return child entries.
*/
- public List getChildEntries()
+ public List<IndexEntry> getChildEntries()
{
return Collections.unmodifiableList( childEntries );
}
@@ -141,11 +140,11 @@ public class IndexEntry
*
* @param entries the entries.
*/
- public void setChildEntries( List entries )
+ public void setChildEntries( List<IndexEntry> entries )
{
if ( entries == null )
{
- childEntries = new ArrayList();
+ childEntries = new ArrayList<IndexEntry>();
}
this.childEntries = entries;
@@ -167,7 +166,7 @@ public class IndexEntry
return null;
}
- List entries = parent.getChildEntries();
+ List<IndexEntry> entries = parent.getChildEntries();
int index = entries.indexOf( this );
@@ -176,7 +175,7 @@ public class IndexEntry
return null;
}
- return (IndexEntry) entries.get( index + 1 );
+ return entries.get( index + 1 );
}
/**
@@ -191,7 +190,7 @@ public class IndexEntry
return null;
}
- List entries = parent.getChildEntries();
+ List<IndexEntry> entries = parent.getChildEntries();
int index = entries.indexOf( this );
@@ -200,7 +199,7 @@ public class IndexEntry
return null;
}
- return (IndexEntry) entries.get( index - 1 );
+ return entries.get( index - 1 );
}
/**
@@ -210,14 +209,14 @@ public class IndexEntry
*/
public IndexEntry getFirstEntry()
{
- List entries = getChildEntries();
+ List<IndexEntry> entries = getChildEntries();
if ( entries.size() == 0 )
{
return null;
}
- return (IndexEntry) entries.get( 0 );
+ return entries.get( 0 );
}
/**
@@ -227,14 +226,14 @@ public class IndexEntry
*/
public IndexEntry getLastEntry()
{
- List entries = getChildEntries();
+ List<IndexEntry> entries = getChildEntries();
if ( entries.size() == 0 )
{
return null;
}
- return (IndexEntry) entries.get( entries.size() - 1 );
+ return entries.get( entries.size() - 1 );
}
/**
@@ -244,7 +243,7 @@ public class IndexEntry
*/
public IndexEntry getRootEntry()
{
- List entries = getChildEntries();
+ List<IndexEntry> entries = getChildEntries();
if ( entries.size() == 0 )
{
@@ -256,7 +255,7 @@ public class IndexEntry
}
else
{
- return (IndexEntry) entries.get( 0 );
+ return entries.get( 0 );
}
}
@@ -300,10 +299,8 @@ public class IndexEntry
indent += " ";
}
- for ( Iterator it = getChildEntries().iterator(); it.hasNext(); )
+ for ( IndexEntry entry : getChildEntries() )
{
- IndexEntry entry = (IndexEntry) it.next();
-
message.append( indent ).append( entry.toString( depth + 1 ) );
}
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java Sat Apr 9 23:15:28 2011
@@ -68,7 +68,7 @@ public class IndexingSink
private String title;
/** The stack. */
- private final Stack stack;
+ private final Stack<IndexEntry> stack;
/** The current type. */
private IndexEntry currentEntry;
@@ -80,7 +80,7 @@ public class IndexingSink
*/
public IndexingSink( IndexEntry sectionEntry )
{
- stack = new Stack();
+ stack = new Stack<IndexEntry>();
stack.push( sectionEntry );
init();
@@ -289,7 +289,7 @@ public class IndexingSink
*/
public IndexEntry peek()
{
- return (IndexEntry) stack.peek();
+ return stack.peek();
}
/** {@inheritDoc} */
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java Sat Apr 9 23:15:28 2011
@@ -19,7 +19,6 @@ package org.apache.maven.doxia.macro;
* under the License.
*/
-import java.util.Iterator;
import java.util.Map;
import org.apache.maven.doxia.logging.Log;
@@ -91,7 +90,7 @@ public abstract class AbstractMacro
*
* @since 1.1.1.
*/
- protected static SinkEventAttributes getAttributesFromMap( Map parameters )
+ protected static SinkEventAttributes getAttributesFromMap( Map<?, ?> parameters )
{
if ( parameters == null )
{
@@ -107,10 +106,9 @@ public abstract class AbstractMacro
final SinkEventAttributeSet atts = new SinkEventAttributeSet( count );
- for ( Iterator it = parameters.keySet().iterator(); it.hasNext(); )
+ for ( Map.Entry<?, ?> entry : parameters.entrySet() )
{
- final Object key = it.next();
- atts.addAttribute( key, parameters.get( key ) );
+ atts.addAttribute( entry.getKey(), entry.getValue() );
}
return atts;
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/EchoMacro.java Sat Apr 9 23:15:28 2011
@@ -21,7 +21,6 @@ package org.apache.maven.doxia.macro;
import org.apache.maven.doxia.sink.Sink;
-import java.util.Iterator;
import org.apache.maven.doxia.sink.SinkEventAttributeSet;
/**
@@ -40,10 +39,8 @@ public class EchoMacro
sink.text( "echo" + EOL );
- for ( Iterator i = request.getParameters().keySet().iterator(); i.hasNext(); )
+ for ( String key : request.getParameters().keySet() )
{
- String key = (String) i.next();
-
// TODO: DOXIA-242: separate or define internal params
if ( "parser".equals( key ) || "sourceContent".equals( key ) )
{
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/MacroRequest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/MacroRequest.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/MacroRequest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/MacroRequest.java Sat Apr 9 23:15:28 2011
@@ -35,7 +35,7 @@ public class MacroRequest
private File basedir;
/** A map of parameters. */
- private Map parameters;
+ private Map<String, Object> parameters;
/**
* Constructor.
@@ -43,7 +43,7 @@ public class MacroRequest
* @param param A map of parameters.
* @param base The current base directory.
*/
- public MacroRequest( Map param, File base )
+ public MacroRequest( Map<String, Object> param, File base )
{
this.parameters = param;
this.basedir = base;
@@ -74,7 +74,7 @@ public class MacroRequest
*
* @return The map of parameters.
*/
- public Map getParameters()
+ public Map<String, Object> getParameters()
{
return parameters;
}
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java Sat Apr 9 23:15:28 2011
@@ -19,8 +19,6 @@ package org.apache.maven.doxia.macro;
* under the License.
*/
-import java.util.Iterator;
-
import org.apache.maven.doxia.sink.Sink;
import org.codehaus.plexus.util.StringUtils;
@@ -54,77 +52,67 @@ public class SwfMacro
String allowScript = "sameDomain";
// assign parameters
- for ( Iterator i = request.getParameters().keySet().iterator(); i.hasNext(); )
+ for ( String key : request.getParameters().keySet() )
{
- String str = "";
- String key = (String) i.next();
+ String str = (String) request.getParameter( key );
if ( key.equals( "src" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
src = str;
}
}
- if ( key.equals( "id" ) )
+ else if ( key.equals( "id" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
id = str;
}
}
- if ( key.equals( "width" ) )
+ else if ( key.equals( "width" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
width = str;
}
}
- if ( key.equals( "height" ) )
+ else if ( key.equals( "height" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
height = str;
}
}
- if ( key.equals( "quality" ) )
+ else if ( key.equals( "quality" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
quality = str;
}
}
- if ( key.equals( "menu" ) )
+ else if ( key.equals( "menu" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
menu = str;
}
}
- if ( key.equals( "loop" ) )
+ else if ( key.equals( "loop" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
loop = str;
}
}
- if ( key.equals( "play" ) )
+ else if ( key.equals( "play" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
play = str;
}
}
- if ( key.equals( "version" ) )
+ else if ( key.equals( "version" ) )
{
- str = (String) request.getParameter( key );
// enable version shorthand
// TODO: put in other shorthand versions
if ( str.equals( "6" ) )
@@ -146,9 +134,8 @@ public class SwfMacro
}
}
}
- if ( key.equals( "allowScript" ) )
+ else if ( key.equals( "allowScript" ) )
{
- str = (String) request.getParameter( key );
if ( StringUtils.isNotEmpty( str ) )
{
allowScript = str;
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/manager/DefaultMacroManager.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/manager/DefaultMacroManager.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/manager/DefaultMacroManager.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/manager/DefaultMacroManager.java Sat Apr 9 23:15:28 2011
@@ -35,13 +35,13 @@ public class DefaultMacroManager
implements MacroManager
{
/** @plexus.requirement role="org.apache.maven.doxia.macro.Macro" */
- private Map macros;
+ private Map<String, Macro> macros;
/** {@inheritDoc} */
public Macro getMacro( String id )
throws MacroNotFoundException
{
- Macro macro = (Macro) macros.get( id );
+ Macro macro = macros.get( id );
if ( macro == null )
{
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java Sat Apr 9 23:15:28 2011
@@ -43,7 +43,7 @@ public class SnippetMacro
extends AbstractMacro
{
/** Holds the cache. */
- private static Map cache = new HashMap();
+ private static Map<String, String> cache = new HashMap<String, String>();
private static final int HOUR = 60;
@@ -51,7 +51,7 @@ public class SnippetMacro
private long timeout = HOUR * HOUR * 1000;
/** Holds the time cache. */
- private static Map timeCached = new HashMap();
+ private static Map<String, Long> timeCached = new HashMap<String, Long>();
/** Debug. */
private boolean debug = false;
@@ -149,7 +149,7 @@ public class SnippetMacro
{
StringBuffer result;
- String cachedSnippet = (String) getCachedSnippet( url, id );
+ String cachedSnippet = getCachedSnippet( url, id );
if ( cachedSnippet != null )
{
@@ -182,7 +182,7 @@ public class SnippetMacro
* @param id The id of the snippet.
* @return The snippet.
*/
- private Object getCachedSnippet( URL url, String id )
+ private String getCachedSnippet( URL url, String id )
{
if ( isCacheTimedout( url, id ) )
{
@@ -227,7 +227,7 @@ public class SnippetMacro
{
String globalId = globalSnippetId( url, id );
- return timeCached.containsKey( globalId ) ? ( (Long) timeCached.get( globalId ) ).longValue() : 0;
+ return timeCached.containsKey( globalId ) ? timeCached.get( globalId ).longValue() : 0;
}
/**
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java Sat Apr 9 23:15:28 2011
@@ -24,7 +24,6 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -63,12 +62,11 @@ public class SnippetReader
public StringBuffer readSnippet( String snippetId )
throws IOException
{
- List lines = readLines( snippetId );
+ List<String> lines = readLines( snippetId );
int minIndent = minIndent( lines );
StringBuffer result = new StringBuffer();
- for ( Iterator iterator = lines.iterator(); iterator.hasNext(); )
+ for ( String line : lines )
{
- String line = (String) iterator.next();
result.append( line.substring( minIndent ) );
result.append( EOL );
}
@@ -81,12 +79,11 @@ public class SnippetReader
* @param lines A List of lines.
* @return the minimal indent.
*/
- int minIndent( List lines )
+ int minIndent( List<String> lines )
{
int minIndent = Integer.MAX_VALUE;
- for ( Iterator iterator = lines.iterator(); iterator.hasNext(); )
+ for ( String line : lines )
{
- String line = (String) iterator.next();
minIndent = Math.min( minIndent, indent( line ) );
}
return minIndent;
@@ -119,12 +116,12 @@ public class SnippetReader
* @return A List of lines.
* @throws IOException if something goes wrong.
*/
- private List readLines( String snippetId )
+ private List<String> readLines( String snippetId )
throws IOException
{
// TODO: DOXIA-386, use InputStreamReader(InputStream in, Charset cs)
BufferedReader reader = new BufferedReader( new InputStreamReader( source.openStream() ) );
- List lines = new ArrayList();
+ List<String> lines = new ArrayList<String>();
try
{
boolean capture = false;
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/toc/TocMacro.java Sat Apr 9 23:15:28 2011
@@ -21,8 +21,6 @@ package org.apache.maven.doxia.macro.toc
import java.io.StringReader;
-import java.util.Iterator;
-
import org.apache.maven.doxia.index.IndexEntry;
import org.apache.maven.doxia.index.IndexingSink;
import org.apache.maven.doxia.macro.AbstractMacro;
@@ -128,10 +126,8 @@ public class TocMacro
int i = 1;
- for ( Iterator it = index.getChildEntries().iterator(); it.hasNext(); )
+ for ( IndexEntry sectionIndex : index.getChildEntries() )
{
- IndexEntry sectionIndex = (IndexEntry) it.next();
-
if ( ( i == section ) || ( section == 0 ) )
{
writeSubSectionN( sink, sectionIndex, 1 );
@@ -168,10 +164,8 @@ public class TocMacro
sink.list();
}
- for ( Iterator it = sectionIndex.getChildEntries().iterator(); it.hasNext(); )
+ for ( IndexEntry subsectionIndex : sectionIndex.getChildEntries() )
{
- IndexEntry subsectionIndex = (IndexEntry) it.next();
-
if ( n == toDepth - 1 )
{
sink.listItem();
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/DefaultSiteModuleManager.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/DefaultSiteModuleManager.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/DefaultSiteModuleManager.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/DefaultSiteModuleManager.java Sat Apr 9 23:15:28 2011
@@ -20,7 +20,6 @@ package org.apache.maven.doxia.module.si
*/
import java.util.Collection;
-import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -40,20 +39,19 @@ public class DefaultSiteModuleManager
/**
* @plexus.requirement role="org.apache.maven.doxia.module.site.SiteModule"
*/
- private Map siteModules;
+ private Map<String, SiteModule> siteModules;
- private Collection siteModulesValues;
+ private Collection<SiteModule> siteModulesValues;
/** {@inheritDoc} */
- public Collection getSiteModules()
+ public Collection<SiteModule> getSiteModules()
{
if ( siteModulesValues == null )
{
- Map siteModulesTmp = new LinkedHashMap();
- for ( Iterator it = siteModules.values().iterator(); it.hasNext(); )
+ Map<Class<?>, SiteModule> siteModulesTmp = new LinkedHashMap<Class<?>, SiteModule>();
+ for ( SiteModule module : siteModules.values() )
{
- Object obj = it.next();
- siteModulesTmp.put( obj.getClass(), obj );
+ siteModulesTmp.put( module.getClass(), module );
}
siteModulesValues = siteModulesTmp.values();
}
@@ -65,7 +63,7 @@ public class DefaultSiteModuleManager
public SiteModule getSiteModule( String id )
throws SiteModuleNotFoundException
{
- SiteModule siteModule = (SiteModule) siteModules.get( id );
+ SiteModule siteModule = siteModules.get( id );
if ( siteModule == null )
{
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/SiteModuleManager.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/SiteModuleManager.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/SiteModuleManager.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/module/site/manager/SiteModuleManager.java Sat Apr 9 23:15:28 2011
@@ -40,7 +40,7 @@ public interface SiteModuleManager
*
* @return The SiteModules.
*/
- Collection getSiteModules();
+ Collection<SiteModule> getSiteModules();
/**
* Returns the SiteModule that corresponds to the given id.
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java Sat Apr 9 23:15:28 2011
@@ -30,7 +30,6 @@ import java.io.Reader;
import java.io.StringReader;
import java.net.URL;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
@@ -100,7 +99,7 @@ public abstract class AbstractXmlParser
private boolean trimmableWhitespace;
- private Map entities;
+ private Map<String, String> entities;
private boolean validate = false;
@@ -259,10 +258,8 @@ public abstract class AbstractXmlParser
{
addLocalEntities( parser, parser.getText() );
- for ( Iterator it = CachedFileEntityResolver.ENTITY_CACHE.values().iterator(); it.hasNext(); )
+ for ( byte[] res : CachedFileEntityResolver.ENTITY_CACHE.values() )
{
- byte[] res = (byte[]) it.next();
-
addDTDEntities( parser, new String( res ) );
}
}
@@ -540,11 +537,11 @@ public abstract class AbstractXmlParser
* @return a map of the defined entities in a local doctype.
* @since 1.1
*/
- protected Map getLocalEntities()
+ protected Map<String, String> getLocalEntities()
{
if ( entities == null )
{
- entities = new LinkedHashMap();
+ entities = new LinkedHashMap<String, String>();
}
return entities;
@@ -704,13 +701,13 @@ public abstract class AbstractXmlParser
implements EntityResolver
{
/** Map with systemId as key and the content of systemId as byte[]. */
- protected static final Map ENTITY_CACHE = new Hashtable();
+ protected static final Map<String, byte[]> ENTITY_CACHE = new Hashtable<String, byte[]>();
/** {@inheritDoc} */
public InputSource resolveEntity( String publicId, String systemId )
throws SAXException, IOException
{
- byte[] res = (byte[]) ENTITY_CACHE.get( systemId );
+ byte[] res = ENTITY_CACHE.get( systemId );
// already cached?
if ( res == null )
{
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=1090706&r1=1090705&r2=1090706&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 Sat Apr 9 23:15:28 2011
@@ -21,7 +21,6 @@ package org.apache.maven.doxia.parser;
import java.io.Reader;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@@ -77,7 +76,7 @@ public class XhtmlBaseParser
/** Map of warn messages with a String as key to describe the error type and a Set as value.
* Using to reduce warn messages. */
- private Map warnMessages;
+ private Map<String, Set<String>> warnMessages;
/** {@inheritDoc} */
public void parse( Reader source, Sink sink )
@@ -965,13 +964,13 @@ public class XhtmlBaseParser
if ( warnMessages == null )
{
- warnMessages = new HashMap();
+ warnMessages = new HashMap<String, Set<String>>();
}
- Set set = (Set) warnMessages.get( key );
+ Set<String> set = warnMessages.get( key );
if ( set == null )
{
- set = new TreeSet();
+ set = new TreeSet<String>();
}
set.add( msg );
warnMessages.put( key, set );
@@ -984,15 +983,10 @@ public class XhtmlBaseParser
{
if ( getLog().isWarnEnabled() && this.warnMessages != null && !isSecondParsing() )
{
- for ( Iterator it = this.warnMessages.entrySet().iterator(); it.hasNext(); )
+ for ( Map.Entry<String, Set<String>> entry : this.warnMessages.entrySet() )
{
- Map.Entry entry = (Map.Entry) it.next();
-
- Set set = (Set) entry.getValue();
- for ( Iterator it2 = set.iterator(); it2.hasNext(); )
+ for ( String msg : entry.getValue() )
{
- String msg = (String) it2.next();
-
getLog().warn( msg );
}
}
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/manager/DefaultParserManager.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/manager/DefaultParserManager.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/manager/DefaultParserManager.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/manager/DefaultParserManager.java Sat Apr 9 23:15:28 2011
@@ -37,13 +37,13 @@ public class DefaultParserManager
/**
* @plexus.requirement role="org.apache.maven.doxia.parser.Parser"
*/
- private Map parsers;
+ private Map<String, Parser> parsers;
/** {@inheritDoc} */
public Parser getParser( String id )
throws ParserNotFoundException
{
- Parser parser = (Parser) parsers.get( id );
+ Parser parser = parsers.get( id );
if ( parser == null )
{
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/PipelineSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/PipelineSink.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/PipelineSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/PipelineSink.java Sat Apr 9 23:15:28 2011
@@ -25,7 +25,6 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.List;
-import java.util.Iterator;
/**
* May be used to invoke the same method on a List of Sinks.
@@ -36,14 +35,14 @@ import java.util.Iterator;
public class PipelineSink
implements InvocationHandler
{
- private List pipeline;
+ private List<Sink> pipeline;
/**
* Constructs a PipelineSink for a given List of Sinks.
*
* @param pipeline A List of Sinks.
*/
- public PipelineSink( List pipeline )
+ public PipelineSink( List<Sink> pipeline )
{
this.pipeline = pipeline;
}
@@ -69,10 +68,8 @@ public class PipelineSink
public Object invoke( Object proxy, Method method, Object[] args )
throws IllegalAccessException, InvocationTargetException
{
- for ( Iterator it = pipeline.iterator(); it.hasNext(); )
+ for ( Sink sink : pipeline )
{
- Sink sink = (Sink) it.next();
-
method.invoke( sink, args );
}
@@ -85,7 +82,7 @@ public class PipelineSink
* @param pipeline A List of Sinks.
* @return a {@link org.apache.maven.doxia.sink.Sink} object.
*/
- public static Sink newInstance( List pipeline )
+ public static Sink newInstance( List<Sink> pipeline )
{
return (Sink) Proxy.newProxyInstance( PipelineSink.class.getClassLoader(),
new Class[]{Sink.class},
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributeSet.java Sat Apr 9 23:15:28 2011
@@ -109,7 +109,7 @@ public class SinkEventAttributeSet
JUSTIFY = new SinkEventAttributeSet( new String[] {ALIGN, "justify"} ).unmodifiable();
}
- private Map attribs;
+ private Map<String, Object> attribs;
private AttributeSet resolveParent;
@@ -128,7 +128,7 @@ public class SinkEventAttributeSet
*/
public SinkEventAttributeSet( int size )
{
- attribs = new LinkedHashMap( size );
+ attribs = new LinkedHashMap<String, Object>( size );
}
/**
@@ -147,7 +147,7 @@ public class SinkEventAttributeSet
throw new IllegalArgumentException( "Missing attribute!" );
}
- attribs = new LinkedHashMap( n / 2 );
+ attribs = new LinkedHashMap<String, Object>( n / 2 );
for ( int i = 0; i < n; i = i + 2 )
{
@@ -163,15 +163,15 @@ public class SinkEventAttributeSet
*/
public SinkEventAttributeSet( AttributeSet attributes )
{
- attribs = new LinkedHashMap( attributes.getAttributeCount() );
+ attribs = new LinkedHashMap<String, Object>( attributes.getAttributeCount() );
- Enumeration names = attributes.getAttributeNames();
+ Enumeration<?> names = attributes.getAttributeNames();
while ( names.hasMoreElements() )
{
Object name = names.nextElement();
- attribs.put( name, attributes.getAttribute( name ) );
+ attribs.put( name.toString(), attributes.getAttribute( name ) );
}
}
@@ -227,7 +227,7 @@ public class SinkEventAttributeSet
}
/** {@inheritDoc} */
- public Enumeration getAttributeNames()
+ public Enumeration<String> getAttributeNames()
{
return Collections.enumeration( attribs.keySet() );
}
@@ -261,7 +261,7 @@ public class SinkEventAttributeSet
{
boolean result = true;
- Enumeration names = attributes.getAttributeNames();
+ Enumeration<?> names = attributes.getAttributeNames();
while ( result && names.hasMoreElements() )
{
@@ -290,7 +290,7 @@ public class SinkEventAttributeSet
return;
}
- Enumeration names = attributes.getAttributeNames();
+ Enumeration<?> names = attributes.getAttributeNames();
while ( names.hasMoreElements() )
{
@@ -307,7 +307,7 @@ public class SinkEventAttributeSet
}
/** {@inheritDoc} */
- public void removeAttributes( Enumeration names )
+ public void removeAttributes( Enumeration<?> names )
{
while ( names.hasMoreElements() )
{
@@ -328,7 +328,7 @@ public class SinkEventAttributeSet
}
else
{
- Enumeration names = attributes.getAttributeNames();
+ Enumeration<?> names = attributes.getAttributeNames();
while ( names.hasMoreElements() )
{
@@ -359,7 +359,7 @@ public class SinkEventAttributeSet
public Object clone()
{
SinkEventAttributeSet attr = new SinkEventAttributeSet( attribs.size() );
- attr.attribs = new LinkedHashMap( attribs );
+ attr.attribs = new LinkedHashMap<String, Object>( attribs );
if ( resolveParent != null )
{
@@ -397,11 +397,11 @@ public class SinkEventAttributeSet
public String toString()
{
StringBuffer s = new StringBuffer();
- Enumeration names = getAttributeNames();
+ Enumeration<String> names = getAttributeNames();
while ( names.hasMoreElements() )
{
- String key = names.nextElement().toString();
+ String key = names.nextElement();
String value = getAttribute( key ).toString();
s.append( ' ' ).append( key ).append( '=' ).append( value );
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=1090706&r1=1090705&r2=1090706&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 Sat Apr 9 23:15:28 2011
@@ -19,7 +19,6 @@ package org.apache.maven.doxia.sink;
* under the License.
*/
-
import java.util.Enumeration;
import java.util.Arrays;
@@ -187,7 +186,7 @@ public class SinkUtils
StringBuffer sb = new StringBuffer();
- Enumeration names = att.getAttributeNames();
+ Enumeration<?> names = att.getAttributeNames();
while ( names.hasMoreElements() )
{
@@ -218,7 +217,7 @@ public class SinkUtils
{
StringBuffer sb = new StringBuffer();
- Enumeration names = att.getAttributeNames();
+ Enumeration<?> names = att.getAttributeNames();
while ( names.hasMoreElements() )
{
@@ -266,7 +265,7 @@ public class SinkUtils
MutableAttributeSet atts = new SinkEventAttributeSet( attributes.getAttributeCount() );
- Enumeration names = attributes.getAttributeNames();
+ Enumeration<?> names = attributes.getAttributeNames();
while ( names.hasMoreElements() )
{
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=1090706&r1=1090705&r2=1090706&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 Sat Apr 9 23:15:28 2011
@@ -24,7 +24,6 @@ import java.io.StringWriter;
import java.io.Writer;
import java.util.Enumeration;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
@@ -77,26 +76,26 @@ public class XhtmlBaseSink
private boolean verbatimFlag;
/** Stack of alignment int[] of table cells. */
- private final LinkedList cellJustifStack;
+ private final LinkedList<int[]> cellJustifStack;
/** Stack of justification of table cells. */
- private final LinkedList isCellJustifStack;
+ private final LinkedList<Boolean> isCellJustifStack;
/** Stack of current table cell. */
- private final LinkedList cellCountStack;
+ private final LinkedList<Integer> cellCountStack;
/** Used to style successive table rows differently. */
private boolean evenTableRow = true;
/** The stack of StringWriter to write the table result temporary, so we could play with the output DOXIA-177. */
- private final LinkedList tableContentWriterStack;
+ private final LinkedList<StringWriter> tableContentWriterStack;
- private final LinkedList tableCaptionWriterStack;
+ private final LinkedList<StringWriter> tableCaptionWriterStack;
- private final LinkedList tableCaptionXMLWriterStack;
+ private final LinkedList<PrettyPrintXMLWriter> tableCaptionXMLWriterStack;
/** The stack of table caption */
- private final LinkedList tableCaptionStack;
+ private final LinkedList<String> tableCaptionStack;
/** used to store attributes passed to table(). */
protected MutableAttributeSet tableAttributes;
@@ -127,7 +126,7 @@ public class XhtmlBaseSink
/** Map of warn messages with a String as key to describe the error type and a Set as value.
* Using to reduce warn messages. */
- private Map warnMessages;
+ private Map<String, Set<String>> warnMessages;
// ----------------------------------------------------------------------
// Constructor
@@ -142,13 +141,13 @@ public class XhtmlBaseSink
{
this.writer = new PrintWriter( out );
- this.cellJustifStack = new LinkedList();
- this.isCellJustifStack = new LinkedList();
- this.cellCountStack = new LinkedList();
- this.tableContentWriterStack = new LinkedList();
- this.tableCaptionWriterStack = new LinkedList();
- this.tableCaptionXMLWriterStack = new LinkedList();
- this.tableCaptionStack = new LinkedList();
+ this.cellJustifStack = new LinkedList<int[]>();
+ this.isCellJustifStack = new LinkedList<Boolean>();
+ this.cellCountStack = new LinkedList<Integer>();
+ this.tableContentWriterStack = new LinkedList<StringWriter>();
+ this.tableCaptionWriterStack = new LinkedList<StringWriter>();
+ this.tableCaptionXMLWriterStack = new LinkedList<PrettyPrintXMLWriter>();
+ this.tableCaptionStack = new LinkedList<String>();
init();
}
@@ -235,7 +234,7 @@ public class XhtmlBaseSink
*/
protected void setCellCount( int count )
{
- this.cellCountStack.addLast( new Integer( count ) );
+ this.cellCountStack.addLast( count );
}
/**
@@ -1913,7 +1912,7 @@ public class XhtmlBaseSink
{
SinkEventAttributeSet set = new SinkEventAttributeSet( attributes.getAttributeCount() );
- Enumeration names = attributes.getAttributeNames();
+ Enumeration<?> names = attributes.getAttributeNames();
while ( names.hasMoreElements() )
{
@@ -1938,16 +1937,10 @@ public class XhtmlBaseSink
if ( getLog().isWarnEnabled() && this.warnMessages != null )
{
- for ( Iterator it = this.warnMessages.entrySet().iterator(); it.hasNext(); )
+ for ( Map.Entry<String, Set<String>> entry : this.warnMessages.entrySet() )
{
- Map.Entry entry = (Map.Entry) it.next();
-
- Set set = (Set) entry.getValue();
-
- for ( Iterator it2 = set.iterator(); it2.hasNext(); )
+ for ( String msg : entry.getValue() )
{
- String msg = (String) it2.next();
-
getLog().warn( msg );
}
}
@@ -2014,11 +2007,11 @@ public class XhtmlBaseSink
{
if ( !this.tableCaptionXMLWriterStack.isEmpty() && this.tableCaptionXMLWriterStack.getLast() != null )
{
- ( (PrettyPrintXMLWriter) this.tableCaptionXMLWriterStack.getLast() ).writeText( unifyEOLs( text ) );
+ this.tableCaptionXMLWriterStack.getLast().writeText( unifyEOLs( text ) );
}
else if ( !this.tableContentWriterStack.isEmpty() && this.tableContentWriterStack.getLast() != null )
{
- ( (StringWriter) this.tableContentWriterStack.getLast() ).write( unifyEOLs( text ) );
+ this.tableContentWriterStack.getLast().write( unifyEOLs( text ) );
}
else
{
@@ -2036,24 +2029,23 @@ public class XhtmlBaseSink
else
{
String tag = ( getNameSpace() != null ? getNameSpace() + ":" : "" ) + t.toString();
- ( (PrettyPrintXMLWriter) this.tableCaptionXMLWriterStack.getLast() ).startElement( tag );
+ this.tableCaptionXMLWriterStack.getLast().startElement( tag );
if ( att != null )
{
- Enumeration names = att.getAttributeNames();
+ Enumeration<?> names = att.getAttributeNames();
while ( names.hasMoreElements() )
{
Object key = names.nextElement();
Object value = att.getAttribute( key );
- ( (PrettyPrintXMLWriter) this.tableCaptionXMLWriterStack.getLast() )
- .addAttribute( key.toString(), value.toString() );
+ this.tableCaptionXMLWriterStack.getLast().addAttribute( key.toString(), value.toString() );
}
}
if ( isSimpleTag )
{
- ( (PrettyPrintXMLWriter) this.tableCaptionXMLWriterStack.getLast() ).endElement();
+ this.tableCaptionXMLWriterStack.getLast().endElement();
}
}
}
@@ -2067,7 +2059,7 @@ public class XhtmlBaseSink
}
else
{
- ( (PrettyPrintXMLWriter) this.tableCaptionXMLWriterStack.getLast() ).endElement();
+ this.tableCaptionXMLWriterStack.getLast().endElement();
}
}
@@ -2091,13 +2083,13 @@ public class XhtmlBaseSink
if ( warnMessages == null )
{
- warnMessages = new HashMap();
+ warnMessages = new HashMap<String, Set<String>>();
}
- Set set = (Set) warnMessages.get( key );
+ Set<String> set = warnMessages.get( key );
if ( set == null )
{
- set = new TreeSet();
+ set = new TreeSet<String>();
}
set.add( msg );
warnMessages.put( key, set );
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/render/RenderingContext.java Sat Apr 9 23:15:28 2011
@@ -48,7 +48,7 @@ public class RenderingContext
private final String extension;
- private Map/*String, String*/ attributes;
+ private Map<String, String> attributes;
/**
* <p>Constructor for RenderingContext.</p>
@@ -107,7 +107,7 @@ public class RenderingContext
this.parserId = parserId;
- this.attributes = new HashMap();
+ this.attributes = new HashMap<String, String>();
}
/**
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java Sat Apr 9 23:15:28 2011
@@ -23,6 +23,7 @@ import java.io.UnsupportedEncodingExcept
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.swing.text.html.HTML.Tag;
@@ -61,15 +62,15 @@ public class HtmlTools
HtmlMarkup.TR, HtmlMarkup.TT, HtmlMarkup.U, HtmlMarkup.UL, HtmlMarkup.VAR
};
- private static final HashMap TAG_MAP = new HashMap( ALL_TAGS.length );
+ private static final Map<String, Tag> TAG_MAP = new HashMap<String, Tag>( ALL_TAGS.length );
private static final int ASCII = 0x7E;
static
{
- for ( int i = 0; i < ALL_TAGS.length; i++ )
+ for ( Tag tag : ALL_TAGS )
{
- TAG_MAP.put( ALL_TAGS[i].toString(), ALL_TAGS[i] );
+ TAG_MAP.put( tag.toString(), tag );
}
}
@@ -253,7 +254,7 @@ public class HtmlTools
}
String tmp = unescaped;
- List entities = new ArrayList();
+ List<String> entities = new ArrayList<String>();
while ( true )
{
int i = tmp.indexOf( "&#x" );
@@ -278,10 +279,8 @@ public class HtmlTools
}
}
- for ( int i = 0; i < entities.size(); i++ )
+ for ( String entity : entities )
{
- String entity = (String) entities.get( i );
-
int codePoint = Integer.parseInt( entity, 16 );
unescaped = StringUtils.replace( unescaped, "&#x" + entity + ";", new String( toChars( codePoint ) ) );
}
Modified: maven/doxia/doxia/trunk/doxia-logging-api/pom.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-logging-api/pom.xml?rev=1090706&r1=1090705&r2=1090706&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-logging-api/pom.xml (original)
+++ maven/doxia/doxia/trunk/doxia-logging-api/pom.xml Sat Apr 9 23:15:28 2011
@@ -25,7 +25,7 @@ under the License.
<parent>
<artifactId>doxia</artifactId>
<groupId>org.apache.maven.doxia</groupId>
- <version>1.1.5-SNAPSHOT</version>
+ <version>1.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>