cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1496106 - /cxf/web/src/main/java/org/apache/cxf/cwiki/Page.java
Date Mon, 24 Jun 2013 16:01:01 GMT
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);
+        }
     }
 
     



Mime
View raw message