buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSetTask.java
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 645 b8d81fa19e7d
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSetTask.java	Wed Jun 16 16:51:40 2010 +0300
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSetTask.java	Fri Aug 13 14:59:05 2010 +0300
@@ -1,34 +1,35 @@
 /*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: 
+ *
+ */
 
 package com.nokia.helium.core.ant.taskdefs;
 
+import java.util.Vector;
+
 import org.apache.tools.ant.BuildException;
-import java.util.Vector;
+import org.apache.tools.ant.Task;
 
 import com.nokia.helium.core.ant.MappedVariable;
 import com.nokia.helium.core.ant.VariableMap;
-import org.apache.tools.ant.Task;
 import com.nokia.helium.core.ant.types.VariableSet;
 
-
 /**
- * To retrive a variable value from a collection of variable set based on name, which contains property-value in pair.
- *  
+ * To retrive a variable value from a collection of variable set based on name, which contains
+ * property-value in pair.
+ * 
  * <pre>
  * Example:
  * 
@@ -42,23 +43,24 @@
  * &lt;hlm:argSet refid="test.variableSet"/&gt;
  * &lt;/hlm:getVariableValue&gt;
  * </pre>
+ * 
  * @ant.task name="getVariableValue"
  */
 public class GetValueFromVariableSetTask extends Task {
     private String name;
     private String property;
     private boolean failOnError = true;
-    
-   private Vector<VariableMap> variableMaps = new Vector<VariableMap>();
-    
+
+    private Vector<VariableMap> variableMaps = new Vector<VariableMap>();
+
     public void setName(String name) {
         this.name = name;
     }
 
     /**
-     * Helper function to set failonerror attribute for the task. 
-     * @param failStatus, if true will fail the build if no variable is found for 
-     * matching name.
+     * Helper function to set failonerror attribute for the task.
+     * 
+     * @param failStatus, if true will fail the build if no variable is found for matching name.
      */
     public void setFailOnError(boolean failStatus) {
         failOnError = failStatus;
@@ -66,6 +68,7 @@
 
     /**
      * Helper function to store the name of the property where the value to be stored
+     * 
      * @param property name of the property where the result to be stored
      */
     public void setProperty(String property) {
@@ -73,7 +76,8 @@
     }
 
     /**
-     * Helper function to create the VariableIFImpl object. 
+     * Helper function to create the VariableIFImpl object.
+     * 
      * @return created VariableIFImpl instance
      */
     public VariableSet createVariableIFImpl() {
@@ -82,9 +86,9 @@
         return var;
     }
 
-    
     /**
      * Helper function to add the newly created variable set. Called by ant.
+     * 
      * @param vs variable set to be added.
      */
     public void add(VariableMap vs) {
@@ -95,23 +99,24 @@
         if (variableMaps.isEmpty()) {
             throw new BuildException("variable interface cannot be null");
         }
-        if (variableMaps.size() > 1 ) {
+        if (variableMaps.size() > 1) {
             throw new BuildException("maximum one variable interface can be set");
         }
         return variableMaps.elementAt(0);
     }
-    
 
     /**
      * Task to get the name / value pair
+     * 
      * @return return the name / value pair for the variable set.
      */
     public void execute() {
-        if (name == null)
+        if (name == null) {
             throw new BuildException("'name' attribute has not been defined.");
-        if (property == null)
-            throw new BuildException(
-                    "'property' attribute has not been defined.");
+        }
+        if (property == null) {
+            throw new BuildException("'property' attribute has not been defined.");
+        }
         VariableMap variableMap = getVariableInterface();
         for (MappedVariable var : variableMap.getVariables()) {
             if (var.getName().equals(name)) {