jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r659806 - in /incubator/jspwiki/trunk/src/com/ecyrd/jspwiki: content/ diff/ event/ parser/
Date Sat, 24 May 2008 12:33:28 GMT
Author: jalkanen
Date: Sat May 24 05:33:28 2008
New Revision: 659806

URL: http://svn.apache.org/viewvc?rev=659806&view=rev
Log:
Fixed a couple of checkstyle warnings.

Added:
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/package.html
Modified:
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/PageRenamer.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/ContextualDiffProvider.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/event/WikiEvent.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/HeadingListener.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/MarkupParser.java

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/PageRenamer.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/PageRenamer.java?rev=659806&r1=659805&r2=659806&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/PageRenamer.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/PageRenamer.java Sat May 24 05:33:28
2008
@@ -158,6 +158,7 @@
      *  @param fromPage The old page
      *  @param toPage The new page
      */
+    @SuppressWarnings("unchecked")
     private void updateReferrers( WikiContext context, WikiPage fromPage, WikiPage toPage
)
     {
         WikiEngine engine = context.getEngine();

Added: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/package.html
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/package.html?rev=659806&view=auto
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/package.html (added)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/content/package.html Sat May 24 05:33:28
2008
@@ -0,0 +1,13 @@
+<body>
+Provides content management functionality for JSPWiki.
+
+<h2>Package specification</h2>
+
+<p>This package will in 3.0 contain all content management functionality.  Currently
+it is a bit in-the-making.</p>
+
+<h2>Related documentation</h2>
+
+TBD.
+
+</body>
\ No newline at end of file

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/ContextualDiffProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/ContextualDiffProvider.java?rev=659806&r1=659805&r2=659806&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/ContextualDiffProvider.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/ContextualDiffProvider.java Sat May
24 05:33:28 2008
@@ -51,6 +51,10 @@
 
     private static final Logger log = Logger.getLogger( ContextualDiffProvider.class );
 
+    /**
+     *  A jspwiki.properties value to define how many characters are shown around the change
context.
+     *  The current value is <tt>{@value}</tt>.
+     */
     public static final String PROP_UNCHANGED_CONTEXT_LIMIT = "jspwiki.contextualDiffProvider.unchangedContextLimit";
 
     //TODO all of these publics can become jspwiki.properties entries...
@@ -86,12 +90,16 @@
     private int m_unchangedContextLimit = LIMIT_MAX_VALUE;
 
 
-
+    /**
+     *  Constructs this provider.
+     */
     public ContextualDiffProvider()
     {}
 
     /**
      * @see com.ecyrd.jspwiki.WikiProvider#getProviderInfo()
+     * 
+     * {@inheritDoc}
      */
     public String getProviderInfo()
     {
@@ -101,11 +109,13 @@
     /**
      * @see com.ecyrd.jspwiki.WikiProvider#initialize(com.ecyrd.jspwiki.WikiEngine,
      *      java.util.Properties)
+     *      
+     * {@inheritDoc}
      */
     public void initialize(WikiEngine engine, Properties properties) throws NoRequiredPropertyException,
IOException
     {
-        String configuredLimit = properties.getProperty(PROP_UNCHANGED_CONTEXT_LIMIT, Integer
-            .toString(LIMIT_MAX_VALUE));
+        String configuredLimit = properties.getProperty(PROP_UNCHANGED_CONTEXT_LIMIT, 
+                                                        Integer.toString(LIMIT_MAX_VALUE));
         int limit = LIMIT_MAX_VALUE;
         try
         {
@@ -125,6 +135,8 @@
      * Do a colored diff of the two regions. This. is. serious. fun. ;-)
      *
      * @see com.ecyrd.jspwiki.diff.DiffProvider#makeDiffHtml(WikiContext, String, String)
+     * 
+     * {@inheritDoc}
      */
     public synchronized String makeDiffHtml( WikiContext ctx, String wikiOld, String wikiNew
)
     {
@@ -178,7 +190,7 @@
     {
         String[] linesArray = Diff.stringToArray( wikiText );
 
-        List list = new ArrayList();
+        List<String> list = new ArrayList<String>();
 
         for( int i = 0; i < linesArray.length; i++ )
         {
@@ -201,7 +213,7 @@
             list.add(m_lineBreakHtml); // Line Break
         }
 
-        return (String[])list.toArray( new String[0] );
+        return list.toArray( new String[0] );
     }
 
     /**

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java?rev=659806&r1=659805&r2=659806&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/diff/TraditionalDiffProvider.java Sat May
24 05:33:28 2008
@@ -41,7 +41,7 @@
 
 
 /**
- * This is the JSPWiki 'traditional' diff.
+ * This is the JSPWiki 'traditional' diff.  It uses an internal diff engine.
  * 
  * @author Erik Bunn
  * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
@@ -57,12 +57,16 @@
     private static final String CSS_DIFF_CLOSE = "</td></tr>" + Diff.NL;
 
 
+    /**
+     *  Constructs the provider.
+     */
     public TraditionalDiffProvider()
     {
     }
 
 
     /**
+     * {@inheritDoc}
      * @see com.ecyrd.jspwiki.WikiProvider#getProviderInfo()
      */
     public String getProviderInfo()
@@ -71,6 +75,7 @@
     }
 
     /**
+     * {@inheritDoc}
      * @see com.ecyrd.jspwiki.WikiProvider#initialize(com.ecyrd.jspwiki.WikiEngine, java.util.Properties)
      */
     public void initialize(WikiEngine engine, Properties properties)
@@ -81,6 +86,12 @@
     /**
      * Makes a diff using the BMSI utility package. We use our own diff printer,
      * which makes things easier.
+     * 
+     * @param ctx The WikiContext in which the diff should be made.
+     * @param p1 The first string
+     * @param p2 The second string.
+     * 
+     * @return Full HTML diff.
      */
     public String makeDiffHtml( WikiContext ctx, String p1, String p2 )
     {
@@ -117,7 +128,7 @@
     }
 
 
-    public static final class RevisionPrint
+    private static final class RevisionPrint
         implements RevisionVisitor
     {
         private StringBuffer m_result = null;

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/event/WikiEvent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/event/WikiEvent.java?rev=659806&r1=659805&r2=659806&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/event/WikiEvent.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/event/WikiEvent.java Sat May 24 05:33:28
2008
@@ -117,6 +117,9 @@
      * this method returns true if the event type is anything except
      * {@link #ERROR} or {@link #UNDEFINED}. This method is meant to
      * be subclassed as appropriate.
+     * 
+     * @param type The value to test.
+     * @return true, if the value is a valid WikiEvent type.
      */
     public static boolean isValidType( int type )
     {

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/HeadingListener.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/HeadingListener.java?rev=659806&r1=659805&r2=659806&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/HeadingListener.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/HeadingListener.java Sat May 24 05:33:28
2008
@@ -23,12 +23,16 @@
 import com.ecyrd.jspwiki.WikiContext;
 
 /**
- *  Provides a listener interface for headings
+ *  Provides a listener interface for headings.  This is used in parsing,
+ *  and e.g. the TableOfContents is built using this listener.
  */
 public interface HeadingListener
 {
     /**
      *  Is called whenever a heading is encountered in the stream.
+     *  
+     *  @param context The WikiContext
+     *  @param hd The heading which was just encountered.
      */
     public void headingAdded( WikiContext context, Heading hd );
 }

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/MarkupParser.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/MarkupParser.java?rev=659806&r1=659805&r2=659806&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/MarkupParser.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/parser/MarkupParser.java Sat May 24 05:33:28
2008
@@ -48,11 +48,11 @@
     protected WikiContext    m_context;
 
     /** Optionally stores internal wikilinks */
-    protected ArrayList      m_localLinkMutatorChain    = new ArrayList();
-    protected ArrayList      m_externalLinkMutatorChain = new ArrayList();
-    protected ArrayList      m_attachmentLinkMutatorChain = new ArrayList();
-    protected ArrayList      m_headingListenerChain     = new ArrayList();
-    protected ArrayList      m_linkMutators             = new ArrayList();
+    protected ArrayList<StringTransmutator>      m_localLinkMutatorChain    = new ArrayList<StringTransmutator>();
+    protected ArrayList<StringTransmutator>      m_externalLinkMutatorChain = new ArrayList<StringTransmutator>();
+    protected ArrayList<StringTransmutator>      m_attachmentLinkMutatorChain = new
ArrayList<StringTransmutator>();
+    protected ArrayList<HeadingListener>         m_headingListenerChain     = new ArrayList<HeadingListener>();
+    protected ArrayList<StringTransmutator>      m_linkMutators             = new ArrayList<StringTransmutator>();
 
     protected boolean        m_inlineImages             = true;
 
@@ -73,6 +73,13 @@
     /** Lists all punctuation characters allowed in page names. */
     public    static final String           PUNCTUATION_CHARS_ALLOWED = " ()&+,-=._$";
 
+    /**
+     *  Constructs a MarkupParser.  The subclass must call this constructor
+     *  to set up the necessary bits and pieces.
+     *  
+     *  @param context The WikiContext.
+     *  @param in The reader from which we are reading the bytes from.
+     */
     protected MarkupParser( WikiContext context, Reader in )
     {
         m_engine = context.getEngine();
@@ -155,6 +162,12 @@
         }
     }
 
+    /**
+     *  Adds a HeadingListener to the parser chain.  It will be called whenever
+     *  a parsed header is found.
+     *  
+     *  @param listener The listener to add.
+     */
     public void addHeadingListener( HeadingListener listener )
     {
         if( listener != null )
@@ -163,6 +176,9 @@
         }
     }
 
+    /**
+     *  Disables access rule parsing.
+     */
     public void disableAccessRules()
     {
         m_parseAccessRules = false;
@@ -183,7 +199,7 @@
     /**
      *  Parses the document.
      *  @return the parsed document, as a WikiDocument
-     *  @throws IOException
+     *  @throws IOException If something goes wrong.
      */
     public abstract WikiDocument parse()
          throws IOException;
@@ -207,7 +223,7 @@
      * @throws NullPointerException If you have not yet created an input document.
      */
     protected final int nextToken()
-        throws IOException
+        throws IOException, NullPointerException
     {
         // if( m_in == null ) return -1;
         m_pos++;
@@ -217,6 +233,9 @@
     /**
      *  Push back any character to the current input.  Does not
      *  push back a read EOF, though.
+     *  
+     *  @throws IOException In case the character cannot be pushed back.
+     *  @param c Character to push back.
      */
     protected void pushBack( int c )
         throws IOException



Mime
View raw message