(no commit message)
[utils] / crawler / basic / src / org / wamblee / crawler / impl / ConfigurationImpl.java
index 54874559b81e19429453f68f08fb1e1547faedde..4a64c6e5d54789965422c4ba15ab32d70261ba16 100644 (file)
@@ -12,7 +12,7 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */ 
+ */
 
 package org.wamblee.crawler.impl;
 
@@ -22,44 +22,51 @@ import org.wamblee.crawler.Configuration;
 import org.wamblee.crawler.PageRequest;
 import org.wamblee.crawler.PageType;
 
-
 /**
- * Implementation of the configuration for the crawler. 
+ * Implementation of the configuration for the crawler.
  */
 public class ConfigurationImpl implements Configuration {
-    
+
     private List<UrlConfig> _urlConfig;
-    private List<PageTypeConfig> _pageTypeConfig; 
-    
-    public ConfigurationImpl(List<UrlConfig> aUrlConfig, List<PageTypeConfig> aPageTypeConfig) { 
-        _urlConfig = aUrlConfig;  
-        _pageTypeConfig = aPageTypeConfig; 
+
+    private List<PageTypeConfig> _pageTypeConfig;
+
+    public ConfigurationImpl(List<UrlConfig> aUrlConfig,
+            List<PageTypeConfig> aPageTypeConfig) {
+        _urlConfig = aUrlConfig;
+        _pageTypeConfig = aPageTypeConfig;
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.wamblee.crawler.Configuration#getRequest(java.lang.String)
      */
     public PageRequest getRequest(String aUrl) {
-        
-        for (UrlConfig config: _urlConfig) { 
-            PageRequest request = config.getRequest(aUrl); 
-            if ( request != null ) { 
-                return request; 
+
+        for (UrlConfig config : _urlConfig) {
+            PageRequest request = config.getRequest(aUrl);
+            if (request != null) {
+                return request;
             }
         }
-        throw new RuntimeException("No configuration matched the URL '" + aUrl + "'");
+        throw new RuntimeException("No configuration matched the URL '" + aUrl
+                + "'");
     }
-    
-    /* (non-Javadoc)
+
+    /*
+     * (non-Javadoc)
+     * 
      * @see org.wamblee.crawler.Configuration#getRequest(org.wamblee.crawler.PageType)
      */
     public PageRequest getRequest(PageType aType) {
-        for (PageTypeConfig config: _pageTypeConfig) { 
-            PageRequest request = config.getRequest(aType.getType()); 
-            if ( request != null ) { 
-                return request; 
+        for (PageTypeConfig config : _pageTypeConfig) {
+            PageRequest request = config.getRequest(aType.getType());
+            if (request != null) {
+                return request;
             }
         }
-        throw new RuntimeException("No configuration matched type '" + aType + "'");
+        throw new RuntimeException("No configuration matched type '" + aType
+                + "'");
     }
 }