shindig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1145341 - in /shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features: FeatureParser.java FeatureRegistry.java
Date Mon, 11 Jul 2011 20:48:53 GMT
Author: johnh
Date: Mon Jul 11 20:48:53 2011
New Revision: 1145341

URL: http://svn.apache.org/viewvc?rev=1145341&view=rev
Log:
Adds support for syntax <api supportDefer="true">


Modified:
    shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureParser.java
    shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureRegistry.java

Modified: shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureParser.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureParser.java?rev=1145341&r1=1145340&r2=1145341&view=diff
==============================================================================
--- shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureParser.java
(original)
+++ shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureParser.java
Mon Jul 11 20:48:53 2011
@@ -50,6 +50,7 @@ class FeatureParser {
     String name = null;
     List<String> deps = Lists.newArrayList();
     List<ParsedFeature.Bundle> bundles = Lists.newArrayList();
+    boolean supportDefer = false;
    
     NodeList children = doc.getChildNodes();
     for (int i = 0, j = children.getLength(); i < j; ++i) {
@@ -86,6 +87,7 @@ class FeatureParser {
           NodeList apiKids = element.getElementsByTagName("api");
           for (int x = 0, y = apiKids.getLength(); x < y; ++x) {
             Element apiChild = (Element)apiKids.item(x);
+            supportDefer = "true".equalsIgnoreCase(apiChild.getAttribute("supportDefer"));
             NodeList apiElems = apiChild.getChildNodes();
             for (int a = 0, b = apiElems.getLength(); a < b; ++a) {
               Node apiElemNode = apiElems.item(a);
@@ -100,7 +102,8 @@ class FeatureParser {
               }
             }
           }
-          bundles.add(new ParsedFeature.Bundle(name, type, getAttribs(element), resources,
apiDirectives));
+          bundles.add(new ParsedFeature.Bundle(name, type, getAttribs(element),
+              resources, apiDirectives, supportDefer));
         }
       }
     }
@@ -149,14 +152,16 @@ class FeatureParser {
       private final Map<String, String> attribs;
       private final List<Resource> resources;
       private final List<ApiDirective> apiDirectives;
+      private final boolean supportDefer;
       
       private Bundle(String name, String type, Map<String, String> attribs,
-          List<Resource> resources, List<ApiDirective> apiDirectives) {
+          List<Resource> resources, List<ApiDirective> apiDirectives, boolean
supportDefer) {
         this.name = name;
         this.type = type;
         this.attribs = attribs;
         this.resources = resources;
         this.apiDirectives = apiDirectives;
+        this.supportDefer = supportDefer;
       }
       
       public String getName() {
@@ -178,6 +183,10 @@ class FeatureParser {
       public List<ApiDirective> getApis() {
         return apiDirectives;
       }
+      
+      public boolean isSupportDefer() {
+        return supportDefer;
+      }
     }
     
     static final class Resource {

Modified: shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureRegistry.java
URL: http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureRegistry.java?rev=1145341&r1=1145340&r2=1145341&view=diff
==============================================================================
--- shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureRegistry.java
(original)
+++ shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/features/FeatureRegistry.java
Mon Jul 11 20:48:53 2011
@@ -591,6 +591,10 @@ public class FeatureRegistry {
     public List<ApiDirective> getApis() {
       return bundle.getApis();
     }
+    
+    public boolean isSupportDefer() {
+      return bundle.isSupportDefer();
+    }
 
     public List<String> getApis(ApiDirective.Type type, boolean isExports) {
       ImmutableList.Builder<String> builder = ImmutableList.builder();



Mime
View raw message