You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/06/24 18:01:01 UTC

svn commit: r1496106 - /cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java

Author: dkulp
Date: Mon Jun 24 16:01:01 2013
New Revision: 1496106

URL: http://svn.apache.org/r1496106
Log:
Update to detect code blocks for v1 api

Modified:
    cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java

Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java
URL: http://svn.apache.org/viewvc/cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java?rev=1496106&r1=1496105&r2=1496106&view=diff
==============================================================================
--- cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java (original)
+++ cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java Mon Jun 24 16:01:01 2013
@@ -233,6 +233,33 @@ public class Page extends AbstractPage i
         if (idx != -1) {
             hasBlog = true;
         }
+        idx = c.indexOf("{code");
+        while (idx != -1) {
+            String type = "java";
+            idx += 5;
+            if (c.charAt(idx) != '}') {
+                idx++;
+                int idx2 = c.indexOf('}', idx);
+                if (idx2 != -1) {
+                    String paramString = c.substring(idx, idx2);
+                    String params[] = paramString.split("\\||=");
+                    for (int x = 0; x < params.length; x++) {
+                        if ("type".equals(params[x])) {
+                            type = params[x + 1];
+                            x++;
+                        } else if (CODE_TYPE_MAP.containsKey(params[x])) {
+                            type = params[x];
+                        }
+                    }
+                }
+            }
+
+            if (codeTypes == null) {
+                codeTypes = new CopyOnWriteArraySet<String>();
+            }
+            codeTypes.add(type);
+            idx = c.indexOf("{code", idx + 1);
+        }
     }