jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juanpa...@apache.org
Subject [07/15] jspwiki git commit: delete JSPWikiMarkupParser#isMetadata() and use LinkParsingOperations#isMetadata(String) instead
Date Sun, 03 Dec 2017 18:56:59 GMT
delete JSPWikiMarkupParser#isMetadata() and use LinkParsingOperations#isMetadata(String) instead


Project: http://git-wip-us.apache.org/repos/asf/jspwiki/repo
Commit: http://git-wip-us.apache.org/repos/asf/jspwiki/commit/b6ad5dad
Tree: http://git-wip-us.apache.org/repos/asf/jspwiki/tree/b6ad5dad
Diff: http://git-wip-us.apache.org/repos/asf/jspwiki/diff/b6ad5dad

Branch: refs/heads/master
Commit: b6ad5dadc5e54c38f03725e6ea060049d32f5c3b
Parents: a96dd18
Author: juanpablo <juanpablo@apache.org>
Authored: Sun Dec 3 02:10:23 2017 +0100
Committer: juanpablo <juanpablo@apache.org>
Committed: Sun Dec 3 02:10:23 2017 +0100

----------------------------------------------------------------------
 .../apache/wiki/parser/JSPWikiMarkupParser.java |  8 +----
 .../wiki/parser/LinkParsingOperations.java      | 34 +++++++++++---------
 2 files changed, 19 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jspwiki/blob/b6ad5dad/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java b/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
index 765ef23..cb74995 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
@@ -48,7 +48,6 @@ import org.apache.oro.text.regex.Perl5Compiler;
 import org.apache.oro.text.regex.Perl5Matcher;
 import org.apache.wiki.InternalWikiException;
 import org.apache.wiki.StringTransmutator;
-import org.apache.wiki.VariableManager;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.WikiPage;
 import org.apache.wiki.api.exceptions.PluginException;
@@ -524,11 +523,6 @@ public class JSPWikiMarkupParser extends MarkupParser {
         return false;
     }
 
-    private static boolean isMetadata( String link )
-    {
-        return link.startsWith("{SET");
-    }
-
     /**
      *  These are all of the HTML 4.01 block-level elements.
      */
@@ -1262,7 +1256,7 @@ public class JSPWikiMarkupParser extends MarkupParser {
             return handleAccessRule( linktext );
         }
 
-        if( isMetadata( linktext ) )
+        if( m_linkParsingOperations.isMetadata( linktext ) )
         {
             return handleMetadata( linktext );
         }

http://git-wip-us.apache.org/repos/asf/jspwiki/blob/b6ad5dad/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java b/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java
index edc43d7..9aedc1b 100755
--- a/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParsingOperations.java
@@ -26,13 +26,14 @@ import java.util.List;
 import org.apache.log4j.Logger;
 import org.apache.oro.text.regex.Pattern;
 import org.apache.oro.text.regex.Perl5Matcher;
-import org.apache.wiki.VariableManager;
 import org.apache.wiki.WikiContext;
 import org.apache.wiki.api.exceptions.ProviderException;
 
 
 /**
- * Link parsing operations
+ * Link parsing operations.
+ *
+ * @since 2.10.3
  */
 public class LinkParsingOperations {
 
@@ -85,41 +86,42 @@ public class LinkParsingOperations {
     }
 
     /**
-     * @see {@link JSPWikiMarkupParser#isMetadata()}
+     * Returns true if the link is a metadata link
+     *
+     * @param link The link text
+     * @return {@code true}, if this represents a metadata link.
      */
     public boolean isMetadata( final String link ) {
         return link.startsWith( "{SET" );
     }
 
     /**
-     *  Returns true if the link is really command to insert
-     *  a variable.
-     *  <P>
-     *  Currently we just check if the link starts with "{$".
+     * Returns true if the link is really command to insert a variable.
+     * <P>
+     * Currently we just check if the link starts with "{$".
      *
-     *  @param link The link text
-     *  @return {@code true}, if this represents a variable link.
+     * @param link The link text
+     * @return {@code true}, if this represents a variable link.
      */
     public boolean isVariableLink( String link ) {
         return link.startsWith( "{$" );
     }
 
     /**
-     *  Returns true, if this Link represents an InterWiki link (of the form wiki:page).
+     * Returns true, if this Link represents an InterWiki link (of the form wiki:page).
      *
-     *  @return {@code true}, if this Link represents an InterWiki link, {@code false} otherwise.
+     * @return {@code true}, if this Link represents an InterWiki link, {@code false} otherwise.
      */
     public boolean isInterWikiLink( final String page ) {
         return page.indexOf( ':' ) != -1;
     }
 
     /**
-     *  Figures out if a link is an off-site link.  This recognizes
-     *  the most common protocols by checking how it starts.
+     * Figures out if a link is an off-site link.  This recognizes
+     * the most common protocols by checking how it starts.
      *
-     *  @param link The link to check.
-     *  @return true, if this is a link outside of this wiki.
-     *  @since 2.10.3
+     * @param link The link to check.
+     * @return true, if this is a link outside of this wiki.
      */
     public boolean isExternalLink( final String page ) {
         int idx = Arrays.binarySearch( EXTERNAL_LINKS, page, new StartingComparator() );


Mime
View raw message