incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r611261 [11/43] - in /incubator/imperius/trunk: ./ imperius-javaspl/ imperius-javaspl/src/main/java/org/apache/imperius/javaspl/ imperius-splcore/ imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/ imperius-splcore/src...
Date Fri, 11 Jan 2008 18:57:14 GMT
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java Fri Jan 11 10:56:30 2008
@@ -1,118 +1,118 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import java.util.ArrayList;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.compiler.symboltable.MethodSymbol;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class MethodExpression implements Expression
-{
-    
-    private TypeInfo returnType = new TypeInfo();
-    
-    private ArrayList passedParams;
-    
-//    private SPLSymbolTable symTab;
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private final String sourceClass="MethodExpression";
-    
-    
-    public MethodExpression(MethodSymbol ms, ArrayList pList,
-            SPLSymbolTable symTab)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MethodExpression");
-
-        
-        returnType = ms.getType();
-        passedParams = pList;
-//        this.symTab = symTab;
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MethodExpression");
-        
-    }
-    
-    public Object evaluate()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-       
-        // TODO Auto-generated method stub
-        return null;
-    }
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        // TODO Auto-generated method stub
-        return returnType;
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-       
-        // TODO Auto-generated method stub
-        return true;
-    }
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-        // TODO Auto-generated method stub
-        return false;
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"[ "+ this.passedParams.toString()+" ]";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import java.util.ArrayList;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.compiler.symboltable.MethodSymbol;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class MethodExpression implements Expression
+{
+    
+    private TypeInfo returnType = new TypeInfo();
+    
+    private ArrayList passedParams;
+    
+//    private SPLSymbolTable symTab;
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private final String sourceClass="MethodExpression";
+    
+    
+    public MethodExpression(MethodSymbol ms, ArrayList pList,
+            SPLSymbolTable symTab)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MethodExpression");
+
+        
+        returnType = ms.getType();
+        passedParams = pList;
+//        this.symTab = symTab;
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MethodExpression");
+        
+    }
+    
+    public Object evaluate()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+       
+        // TODO Auto-generated method stub
+        return null;
+    }
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+       
+        // TODO Auto-generated method stub
+        return returnType;
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+       
+        // TODO Auto-generated method stub
+        return true;
+    }
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+       
+        // TODO Auto-generated method stub
+        return false;
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
+        String className=this.getClass().getName();
+        
+        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"[ "+ this.passedParams.toString()+" ]";
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MethodExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java Fri Jan 11 10:56:30 2008
@@ -1,165 +1,165 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public abstract class MultipleArgumentExpression implements Expression
-{
-    
-    protected List _expressions;
-    
-    // protected Expression rhsExp;
-    
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private final String sourceClass="MultipleArgumentExpression";
-    
-    
-    protected TypeInfo _dataType =  new TypeInfo();
-    
-    public MultipleArgumentExpression(List exprList)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MultipleArgumentExpression");
-
-        
-        if (exprList != null)
-        {
-            
-            if (exprList.size() != 0)
-            {
-                this._expressions = new ArrayList();
-                for (int i = 0; i < exprList.size(); i++)
-                {
-                    
-                    Expression l = (Expression) exprList.get(i);
-                    
-                    if (l == null)
-                    {
-                        logger.severe( "expression passed in is null.");
-                        
-                        throw new IllegalArgumentException(
-                                "expression passed in is null.");
-                    }
-                    else
-                    {
-                        this._expressions.add(l);
-                        
-                    }
-                }
-            }
-            else
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"No of arguments should be > 0, but is "
-                        + exprList.size());
-                
-                throw new IllegalArgumentException(
-                        "No of arguments should be > 0, but is "
-                                + exprList.size());
-            }
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"No of arguments passed required number of arguments is 2");
-            
-            throw new IllegalArgumentException(
-                    "No of arguments passed required number of arguments is 2");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MultipleArgumentExpression");
-        
-    }
-    
-    public abstract Object evaluate() throws SPLException;
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
-    }
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-        return this._dataType.getIsArray();
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( ";
-        
-        if (this._expressions.size() != 0)
-        {
-            
-            for (int i = 0; i < this._expressions.size(); i++)
-            {
-                
-                Expression l = (Expression) this._expressions.get(i);
-                
-                if (l == null)
-                {
-                    logger.severe( "expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "expression passed in is null.");
-                }
-                else
-                {
-                    str+=l.toString();
-                    
-                }
-                if(i != this._expressions.size() -1){
-                    str+=" , ";
-                }
-            }
-            str+=" )";
-        }
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-    public abstract boolean validate() throws SPLException;
-    
-    public String getReferenceTypeName() throws SPLException
-    {
-    	//throw new SPLException("Expression not of Reference type");
-    	return null;
-    }
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public abstract class MultipleArgumentExpression implements Expression
+{
+    
+    protected List _expressions;
+    
+    // protected Expression rhsExp;
+    
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private final String sourceClass="MultipleArgumentExpression";
+    
+    
+    protected TypeInfo _dataType =  new TypeInfo();
+    
+    public MultipleArgumentExpression(List exprList)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "MultipleArgumentExpression");
+
+        
+        if (exprList != null)
+        {
+            
+            if (exprList.size() != 0)
+            {
+                this._expressions = new ArrayList();
+                for (int i = 0; i < exprList.size(); i++)
+                {
+                    
+                    Expression l = (Expression) exprList.get(i);
+                    
+                    if (l == null)
+                    {
+                        logger.severe( "expression passed in is null.");
+                        
+                        throw new IllegalArgumentException(
+                                "expression passed in is null.");
+                    }
+                    else
+                    {
+                        this._expressions.add(l);
+                        
+                    }
+                }
+            }
+            else
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"No of arguments should be > 0, but is "
+                        + exprList.size());
+                
+                throw new IllegalArgumentException(
+                        "No of arguments should be > 0, but is "
+                                + exprList.size());
+            }
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"No of arguments passed required number of arguments is 2");
+            
+            throw new IllegalArgumentException(
+                    "No of arguments passed required number of arguments is 2");
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "MultipleArgumentExpression");
+        
+    }
+    
+    public abstract Object evaluate() throws SPLException;
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+       
+        return _dataType;
+    }
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+       
+        return this._dataType.getIsArray();
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
+        String className=this.getClass().getName();
+        
+        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( ";
+        
+        if (this._expressions.size() != 0)
+        {
+            
+            for (int i = 0; i < this._expressions.size(); i++)
+            {
+                
+                Expression l = (Expression) this._expressions.get(i);
+                
+                if (l == null)
+                {
+                    logger.severe( "expression passed in is null.");
+                    
+                    throw new IllegalArgumentException(
+                            "expression passed in is null.");
+                }
+                else
+                {
+                    str+=l.toString();
+                    
+                }
+                if(i != this._expressions.size() -1){
+                    str+=" , ";
+                }
+            }
+            str+=" )";
+        }
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+    public abstract boolean validate() throws SPLException;
+    
+    public String getReferenceTypeName() throws SPLException
+    {
+    	//throw new SPLException("Expression not of Reference type");
+    	return null;
+    }
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/MultipleArgumentExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/NumericExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/NumericExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/NumericExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/NumericExpression.java Fri Jan 11 10:56:30 2008
@@ -1,28 +1,28 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import org.apache.imperius.spl.external.Expression;
-
-public interface NumericExpression extends Expression
-{
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import org.apache.imperius.spl.external.Expression;
+
+public interface NumericExpression extends Expression
+{
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/NumericExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java Fri Jan 11 10:56:30 2008
@@ -1,148 +1,148 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Xiping Wang
- *
- */
-package org.apache.imperius.spl.parser.expressions;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public abstract class QuadrupleArgumentExpression implements Expression
-{
-    
-    protected Expression _exp1;
-    
-    protected Expression _exp2;
-    
-    protected Expression _exp3;
-    
-    protected Expression _exp4;
-    
-   
-    
-    protected TypeInfo _dataType = new TypeInfo();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="class";
-    
-    
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-     
-        
-        return _dataType.getIsArray();
-    }
-    
- 
-    
-    public QuadrupleArgumentExpression(List exprList)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "QuadrupleArgumentExpression");
-
-        if (exprList != null)
-        {
-            if (exprList.size() == 4)
-            {
-                Expression e1 = (Expression) exprList.get(0);
-                Expression e2 = (Expression) exprList.get(1);
-                Expression e3 = (Expression) exprList.get(2);
-                Expression e4 = (Expression) exprList.get(3);
-                if (e1 == null)
-                {
-                    logger.severe(
-                    "first expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "first expression passed in is null.");
-                }
-                
-                if (e2 == null)
-                {
-                    logger.severe(
-                    "second expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "second expression passed in is null.");
-                }
-                
-                if (e3 == null)
-                {
-                    logger.severe(
-                    "third expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "third expression passed in is null.");
-                }
-                
-                if (e4 == null)
-                {
-                    logger.severe(
-                    "fourth expression passed in is null.");
-                    
-                    throw new IllegalArgumentException(
-                            "fourth expression passed in is null.");
-                }
-                
-                this._exp1 = e1;
-                this._exp2 = e2;
-                this._exp3 = e3;
-                this._exp4 = e4;
-                
-            }
-            else
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"number of parameters not 4");
-                
-                throw new IllegalArgumentException("number of parameters not 4");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "QuadrupleArgumentExpression");
-        
-    }
-    
-    public abstract Object evaluate() throws SPLException;
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-     
-        return _dataType;
-    }
-    
-    public abstract boolean validate() throws SPLException;
-    
-    public String getReferenceTypeName() throws SPLException
-    {
-    	return null;
-    	//throw new SPLException("ReferenceTypeName not supported");
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Xiping Wang
+ *
+ */
+package org.apache.imperius.spl.parser.expressions;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public abstract class QuadrupleArgumentExpression implements Expression
+{
+    
+    protected Expression _exp1;
+    
+    protected Expression _exp2;
+    
+    protected Expression _exp3;
+    
+    protected Expression _exp4;
+    
+   
+    
+    protected TypeInfo _dataType = new TypeInfo();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="class";
+    
+    
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+     
+        
+        return _dataType.getIsArray();
+    }
+    
+ 
+    
+    public QuadrupleArgumentExpression(List exprList)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "QuadrupleArgumentExpression");
+
+        if (exprList != null)
+        {
+            if (exprList.size() == 4)
+            {
+                Expression e1 = (Expression) exprList.get(0);
+                Expression e2 = (Expression) exprList.get(1);
+                Expression e3 = (Expression) exprList.get(2);
+                Expression e4 = (Expression) exprList.get(3);
+                if (e1 == null)
+                {
+                    logger.severe(
+                    "first expression passed in is null.");
+                    
+                    throw new IllegalArgumentException(
+                            "first expression passed in is null.");
+                }
+                
+                if (e2 == null)
+                {
+                    logger.severe(
+                    "second expression passed in is null.");
+                    
+                    throw new IllegalArgumentException(
+                            "second expression passed in is null.");
+                }
+                
+                if (e3 == null)
+                {
+                    logger.severe(
+                    "third expression passed in is null.");
+                    
+                    throw new IllegalArgumentException(
+                            "third expression passed in is null.");
+                }
+                
+                if (e4 == null)
+                {
+                    logger.severe(
+                    "fourth expression passed in is null.");
+                    
+                    throw new IllegalArgumentException(
+                            "fourth expression passed in is null.");
+                }
+                
+                this._exp1 = e1;
+                this._exp2 = e2;
+                this._exp3 = e3;
+                this._exp4 = e4;
+                
+            }
+            else
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"number of parameters not 4");
+                
+                throw new IllegalArgumentException("number of parameters not 4");
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "QuadrupleArgumentExpression");
+        
+    }
+    
+    public abstract Object evaluate() throws SPLException;
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+     
+        return _dataType;
+    }
+    
+    public abstract boolean validate() throws SPLException;
+    
+    public String getReferenceTypeName() throws SPLException
+    {
+    	return null;
+    	//throw new SPLException("ReferenceTypeName not supported");
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/QuadrupleArgumentExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ReferenceExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ReferenceExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ReferenceExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ReferenceExpression.java Fri Jan 11 10:56:30 2008
@@ -1,30 +1,30 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import org.apache.imperius.spl.external.Expression;
-
-public interface ReferenceExpression extends Expression
-{
-    
-    String getReferenceTypeName();
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import org.apache.imperius.spl.external.Expression;
+
+public interface ReferenceExpression extends Expression
+{
+    
+    String getReferenceTypeName();
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ReferenceExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java Fri Jan 11 10:56:30 2008
@@ -1,118 +1,118 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Neeraj Joshi
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public abstract class SingleArgumentExpression implements Expression
-{
-    protected Expression _exp;
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-    private final String sourceClass="SingleArgumentExpression";
-        
-    protected TypeInfo _dataType =  new TypeInfo();; 
-    
-   
-    
-    public boolean isArray()
-    {
-        return _dataType.getIsArray();
-    }
-    
-    public SingleArgumentExpression(List exprList)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SingleArgumentExpression");
-
-        if (exprList != null)
-        {
-            if (exprList.size() == 1)
-            {
-                Expression e = (Expression) exprList.get(0);
-                if (e == null)
-                {
-                    logger.severe(Thread.currentThread().getName()+" "+"expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "expression passed in is null.");
-                }
-                
-                this._exp = e;
-                
-            }
-            else
-            {
-                logger.severe(  "expression List size is not equal to one.");
-                throw new IllegalArgumentException(
-                        "expression List size is not equal to one.");
-            }
-        }
-        else
-        {
-            logger.severe( "expression List passed in is null.");
-            throw new IllegalArgumentException(
-                    "expression List passed in is null.");
-        }
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SingleArgumentExpression");
-       
-    }
-    
-    public abstract Object evaluate() throws SPLException;
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+ this._exp.toString()+" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-    public abstract boolean validate() throws SPLException;
-    
-    public String getReferenceTypeName() throws SPLException
-    {
-    	//throw new SPLException("Expression not a referenceExpression");
-    	return null;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Neeraj Joshi
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public abstract class SingleArgumentExpression implements Expression
+{
+    protected Expression _exp;
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    
+    private final String sourceClass="SingleArgumentExpression";
+        
+    protected TypeInfo _dataType =  new TypeInfo();; 
+    
+   
+    
+    public boolean isArray()
+    {
+        return _dataType.getIsArray();
+    }
+    
+    public SingleArgumentExpression(List exprList)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "SingleArgumentExpression");
+
+        if (exprList != null)
+        {
+            if (exprList.size() == 1)
+            {
+                Expression e = (Expression) exprList.get(0);
+                if (e == null)
+                {
+                    logger.severe(Thread.currentThread().getName()+" "+"expression passed in is null.");
+                    throw new IllegalArgumentException(
+                            "expression passed in is null.");
+                }
+                
+                this._exp = e;
+                
+            }
+            else
+            {
+                logger.severe(  "expression List size is not equal to one.");
+                throw new IllegalArgumentException(
+                        "expression List size is not equal to one.");
+            }
+        }
+        else
+        {
+            logger.severe( "expression List passed in is null.");
+            throw new IllegalArgumentException(
+                    "expression List passed in is null.");
+        }
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "SingleArgumentExpression");
+       
+    }
+    
+    public abstract Object evaluate() throws SPLException;
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+       
+        return _dataType;
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
+        String className=this.getClass().getName();
+        
+        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+ this._exp.toString()+" )";
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+    public abstract boolean validate() throws SPLException;
+    
+    public String getReferenceTypeName() throws SPLException
+    {
+    	//throw new SPLException("Expression not a referenceExpression");
+    	return null;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/SingleArgumentExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/StringExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/StringExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/StringExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/StringExpression.java Fri Jan 11 10:56:30 2008
@@ -1,28 +1,28 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import org.apache.imperius.spl.external.Expression;
-
-public interface StringExpression extends Expression
-{
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import org.apache.imperius.spl.external.Expression;
+
+public interface StringExpression extends Expression
+{
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/StringExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java Fri Jan 11 10:56:30 2008
@@ -1,163 +1,163 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.impl.StringConstant;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-public class TimeZoneExpression extends SingleArgumentExpression implements
-        StringExpression
-{
-    
-    public static final String className = TimeZoneExpression.class.getName();
-    
-    
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-    private static final String sourceClass="TimeZoneExpression";
-    
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-       
-        return _dataType.getIsArray();
-    }
-    
-    public TimeZoneExpression(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-            
-        super(exprList);
-        
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "TimeZoneExpression");
-
-        if (validateExpression)
-        {
-            if (!validate())
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
-                        + " has wrong data type passed in.");
-                
-                throw new SPLException("validation error: " + className
-                        + " has wrong data type passed in.");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "TimeZoneExpression");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-
-       
-        try
-        {
-
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-           
-            return this._exp.evaluate();
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation errro: " + e.toString());
-            throw new SPLException("evaluation errro: " + e.toString());
-        }
-
-    }
-    
-    public static TimeZoneExpression getInstance(String tzid,
-            SPLSymbolTable sTab) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-       
-        Expression e = new StringConstant(tzid);
-        List aList = new ArrayList();
-        aList.add(e);
-        boolean validateExp = true;
-        if (sTab.getSymbolTableType() == SPLSymbolTable.COLLECT)
-        {
-            validateExp = false;
-        }
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return new TimeZoneExpression(aList, validateExp);
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-               
-        TypeInfo eType = _exp.getType();
-        
-        _dataType = new TypeInfo(TypeConstants.stringType,null,false);
-        if (TypeResolver.isString(eType))
-        {
-
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-           
-            return true;
-        }
-        
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-       
-        return false;
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+ this._exp.toString()+" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.compiler.symboltable.SPLSymbolTable;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.impl.StringConstant;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+public class TimeZoneExpression extends SingleArgumentExpression implements
+        StringExpression
+{
+    
+    public static final String className = TimeZoneExpression.class.getName();
+    
+    
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    
+    private static final String sourceClass="TimeZoneExpression";
+    
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+       
+       
+        return _dataType.getIsArray();
+    }
+    
+    public TimeZoneExpression(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+            
+        super(exprList);
+        
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "TimeZoneExpression");
+
+        if (validateExpression)
+        {
+            if (!validate())
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
+                        + " has wrong data type passed in.");
+                
+                throw new SPLException("validation error: " + className
+                        + " has wrong data type passed in.");
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "TimeZoneExpression");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+
+       
+        try
+        {
+
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+           
+            return this._exp.evaluate();
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation errro: " + e.toString());
+            throw new SPLException("evaluation errro: " + e.toString());
+        }
+
+    }
+    
+    public static TimeZoneExpression getInstance(String tzid,
+            SPLSymbolTable sTab) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+       
+        Expression e = new StringConstant(tzid);
+        List aList = new ArrayList();
+        aList.add(e);
+        boolean validateExp = true;
+        if (sTab.getSymbolTableType() == SPLSymbolTable.COLLECT)
+        {
+            validateExp = false;
+        }
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+       
+        return new TimeZoneExpression(aList, validateExp);
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+               
+        TypeInfo eType = _exp.getType();
+        
+        _dataType = new TypeInfo(TypeConstants.stringType,null,false);
+        if (TypeResolver.isString(eType))
+        {
+
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+           
+            return true;
+        }
+        
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+       
+        return false;
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
+String className=this.getClass().getName();
+        
+        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+ this._exp.toString()+" )";
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TimeZoneExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java Fri Jan 11 10:56:30 2008
@@ -1,147 +1,147 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public abstract class TripleArgumentExpression implements Expression
-{
-    
-    protected Expression _lhsExp;
-    
-    protected Expression _midExp;
-    
-    protected Expression _rhsExp;
-    
-    protected TypeInfo _dataType = new TypeInfo();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-    private final String sourceClass="TripleArgumentExpression";
-    
-   
-    
-    public boolean isArray()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
-       
-        
-        return _dataType.getIsArray();
-    }
-    
-  
-    
-    public TripleArgumentExpression(List exprList) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "TripleArgumentExpression");
-
-       
-        if (exprList != null)
-        {
-            if (exprList.size() == 3)
-            {
-                Expression l = (Expression) exprList.get(0);
-                Expression m = (Expression) exprList.get(1);
-                Expression r = (Expression) exprList.get(2);
-                if (l == null)
-                {
-                    logger.severe(Thread.currentThread().getName()+" "+"left hand side expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "left hand side expression passed in is null.");
-                }
-                
-                if (m == null)
-                {
-                    logger.severe(Thread.currentThread().getName()+" "+"middle expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "middle expression passed in is null.");
-                }
-                
-                if (r == null)
-                {
-                    logger.severe(Thread.currentThread().getName()+" "+"right hand side expression passed in is null.");
-                    throw new IllegalArgumentException(
-                            "right hand side expression passed in is null.");
-                }
-                
-                this._lhsExp = l;
-                this._midExp = m;
-                this._rhsExp = r;
-                
-            }
-            else
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"number of parameters passed is not 3.");
-                throw new IllegalArgumentException(
-                        "number of parameters passed is not 3.");
-            }
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"parameters passed are null.");
-            throw new IllegalArgumentException("parameters passed are null.");
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "TripleArgumentExpression");
-        
-    }
-    
-    public abstract Object evaluate() throws SPLException;
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+this._lhsExp.toString()+" , "+this._midExp.toString()+" , "+this._rhsExp.toString()+" )";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
- 
-    
-    public abstract boolean validate() throws SPLException;
-    
-    public String getReferenceTypeName() throws SPLException
-    {
-    	//throw new SPLException("Expression is not of type reference");
-    	return null;
-    }
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public abstract class TripleArgumentExpression implements Expression
+{
+    
+    protected Expression _lhsExp;
+    
+    protected Expression _midExp;
+    
+    protected Expression _rhsExp;
+    
+    protected TypeInfo _dataType = new TypeInfo();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    
+    private final String sourceClass="TripleArgumentExpression";
+    
+   
+    
+    public boolean isArray()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "isArray");
+       
+        
+        return _dataType.getIsArray();
+    }
+    
+  
+    
+    public TripleArgumentExpression(List exprList) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "TripleArgumentExpression");
+
+       
+        if (exprList != null)
+        {
+            if (exprList.size() == 3)
+            {
+                Expression l = (Expression) exprList.get(0);
+                Expression m = (Expression) exprList.get(1);
+                Expression r = (Expression) exprList.get(2);
+                if (l == null)
+                {
+                    logger.severe(Thread.currentThread().getName()+" "+"left hand side expression passed in is null.");
+                    throw new IllegalArgumentException(
+                            "left hand side expression passed in is null.");
+                }
+                
+                if (m == null)
+                {
+                    logger.severe(Thread.currentThread().getName()+" "+"middle expression passed in is null.");
+                    throw new IllegalArgumentException(
+                            "middle expression passed in is null.");
+                }
+                
+                if (r == null)
+                {
+                    logger.severe(Thread.currentThread().getName()+" "+"right hand side expression passed in is null.");
+                    throw new IllegalArgumentException(
+                            "right hand side expression passed in is null.");
+                }
+                
+                this._lhsExp = l;
+                this._midExp = m;
+                this._rhsExp = r;
+                
+            }
+            else
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"number of parameters passed is not 3.");
+                throw new IllegalArgumentException(
+                        "number of parameters passed is not 3.");
+            }
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"parameters passed are null.");
+            throw new IllegalArgumentException("parameters passed are null.");
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "TripleArgumentExpression");
+        
+    }
+    
+    public abstract Object evaluate() throws SPLException;
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+       
+        return _dataType;
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
+        String className=this.getClass().getName();
+        
+        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"( "+this._lhsExp.toString()+" , "+this._midExp.toString()+" , "+this._rhsExp.toString()+" )";
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+ 
+    
+    public abstract boolean validate() throws SPLException;
+    
+    public String getReferenceTypeName() throws SPLException
+    {
+    	//throw new SPLException("Expression is not of type reference");
+    	return null;
+    }
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/TripleArgumentExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java Fri Jan 11 10:56:30 2008
@@ -1,93 +1,93 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.parser.expressions;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.Expression;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.util.SPLLogger;
-
-
-public abstract class ZeroArgumentExpression implements Expression
-{
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-    private final String sourceClass="ZeroArgumentExpression";
-        
-    protected TypeInfo _dataType = new TypeInfo();
-    
-   
-    
-    public boolean isArray()
-    {
-        return this._dataType.getIsArray();
-    }
-    
-    public ZeroArgumentExpression(List exprList)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ZeroArgumentExpression");
-
-        /*if (exprList != null)
-        {        throw new IllegalArgumentException(
-                            "ZeroArgumentExpression expression should not be passed arguments");
-         
-        }*/
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ZeroArgumentExpression");
-       
-    }
-    
-    public abstract Object evaluate() throws SPLException;
-    
-    public TypeInfo getType()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
-       
-        return _dataType;
-    }
-    
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-        
-        String className=this.getClass().getName();
-        
-        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"()";
-        
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-    public abstract boolean validate() throws SPLException;
-    
-    public String getReferenceTypeName() throws SPLException
-    {
-    	//throw new SPLException("This expression is not of reference type");
-    	return null;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.parser.expressions;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.Expression;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.util.SPLLogger;
+
+
+public abstract class ZeroArgumentExpression implements Expression
+{
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    
+    private final String sourceClass="ZeroArgumentExpression";
+        
+    protected TypeInfo _dataType = new TypeInfo();
+    
+   
+    
+    public boolean isArray()
+    {
+        return this._dataType.getIsArray();
+    }
+    
+    public ZeroArgumentExpression(List exprList)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "ZeroArgumentExpression");
+
+        /*if (exprList != null)
+        {        throw new IllegalArgumentException(
+                            "ZeroArgumentExpression expression should not be passed arguments");
+         
+        }*/
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "ZeroArgumentExpression");
+       
+    }
+    
+    public abstract Object evaluate() throws SPLException;
+    
+    public TypeInfo getType()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getType");
+       
+        return _dataType;
+    }
+    
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+        
+        String className=this.getClass().getName();
+        
+        String str=className.substring(className.lastIndexOf(".")+1, className.length())+"()";
+        
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+    public abstract boolean validate() throws SPLException;
+    
+    public String getReferenceTypeName() throws SPLException
+    {
+    	//throw new SPLException("This expression is not of reference type");
+    	return null;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/ZeroArgumentExpression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Abs.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Abs.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Abs.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Abs.java Fri Jan 11 10:56:30 2008
@@ -1,164 +1,164 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- */
-//
-
-/**
- * 
- * @author Xiping Change Log: 3/9/07: Neeraj Joshi: Changed signature to take a
- *         list of expressions and boolean This will help in reflection
- * 
- */
-
-package org.apache.imperius.spl.parser.expressions.impl;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.NumericExpression;
-import org.apache.imperius.spl.parser.expressions.SingleArgumentExpression;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-import org.apache.imperius.spl.parser.util.TypeResolver;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public class Abs extends SingleArgumentExpression implements NumericExpression
-{
-    
-    public static final String className = Abs.class.getName();
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    
-
-    private static final String sourceClass="Abs";
-    
-    
-    
-    public Abs(List exprList, boolean validateExpression)
-            throws SPLException
-    {
-        super(exprList);
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Abs");
-
-        
-        if (validateExpression)
-        {
-            if (!validate())
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
-                        + " has wrong data type passed in.");
-                throw new SPLException("validation error: " + className
-                        + " has wrong data type passed in.");
-            }
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Abs");
-        
-    }
-    
-    public Object evaluate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
-        Object returnVal = abs((Number) _exp.evaluate());
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate" + returnVal);
-     
-        return returnVal;
-    }
-    
-    public static Number abs(Number o1) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Number");
-
-        try
-        {
-            Number[] o = new Number[1];
-            o[0] = o1;
-            
-            int resolvedType = TypeResolver.resolveType(o);
-            
-            if (resolvedType == TypeConstants.doubleType)
-            {
-            	Double dVal = new Double(Math.abs(o1.doubleValue())); 
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Number" + dVal);
-                
-                return dVal;
-            }
-            else if (resolvedType == TypeConstants.floatType)
-            {
-            	Float fVal = new Float(Math.abs(o1.floatValue())); 
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Number" + fVal);
-                
-                return fVal;
-            }
-            else if (resolvedType == TypeConstants.longType)
-            {
-            	Long lVal = new Long(Math.abs(o1.longValue())); 
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Number" + lVal);
-                
-                return lVal;
-            }
-            else
-            {
-            	Integer iVal = new Integer(Math.abs(o1.intValue())); 
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Number" + iVal);
-                
-                return iVal;
-            }
-        }
-        catch (Exception e)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
-            
-            throw new SPLException("evaluation error: " + e.toString());
-        }
-    }
-    
-    public boolean validate() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-
-        TypeInfo eType = _exp.getType();
-        
-        // dataType = TypeConstants.numericType;
-        if (TypeResolver.isNumeric(eType) && !eType.getIsArray())
-        {
-            _dataType.copy(eType);
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-            
-            return true;
-        }
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
-     
-        return false;
-    }
-
-	public String getReferenceTypeName() throws SPLException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	
-    public String toString()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-
-        String str = "Abs("+ this._exp.toString() + ")";
-        	
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
-       
-        return str;
-    }
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+//
+
+/**
+ * 
+ * @author Xiping Change Log: 3/9/07: Neeraj Joshi: Changed signature to take a
+ *         list of expressions and boolean This will help in reflection
+ * 
+ */
+
+package org.apache.imperius.spl.parser.expressions.impl;
+
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.NumericExpression;
+import org.apache.imperius.spl.parser.expressions.SingleArgumentExpression;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+import org.apache.imperius.spl.parser.util.TypeResolver;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public class Abs extends SingleArgumentExpression implements NumericExpression
+{
+    
+    public static final String className = Abs.class.getName();
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    
+
+    private static final String sourceClass="Abs";
+    
+    
+    
+    public Abs(List exprList, boolean validateExpression)
+            throws SPLException
+    {
+        super(exprList);
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Abs");
+
+        
+        if (validateExpression)
+        {
+            if (!validate())
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
+                        + " has wrong data type passed in.");
+                throw new SPLException("validation error: " + className
+                        + " has wrong data type passed in.");
+            }
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Abs");
+        
+    }
+    
+    public Object evaluate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
+        Object returnVal = abs((Number) _exp.evaluate());
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate" + returnVal);
+     
+        return returnVal;
+    }
+    
+    public static Number abs(Number o1) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "Number");
+
+        try
+        {
+            Number[] o = new Number[1];
+            o[0] = o1;
+            
+            int resolvedType = TypeResolver.resolveType(o);
+            
+            if (resolvedType == TypeConstants.doubleType)
+            {
+            	Double dVal = new Double(Math.abs(o1.doubleValue())); 
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Number" + dVal);
+                
+                return dVal;
+            }
+            else if (resolvedType == TypeConstants.floatType)
+            {
+            	Float fVal = new Float(Math.abs(o1.floatValue())); 
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Number" + fVal);
+                
+                return fVal;
+            }
+            else if (resolvedType == TypeConstants.longType)
+            {
+            	Long lVal = new Long(Math.abs(o1.longValue())); 
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Number" + lVal);
+                
+                return lVal;
+            }
+            else
+            {
+            	Integer iVal = new Integer(Math.abs(o1.intValue())); 
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Number" + iVal);
+                
+                return iVal;
+            }
+        }
+        catch (Exception e)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
+            
+            throw new SPLException("evaluation error: " + e.toString());
+        }
+    }
+    
+    public boolean validate() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+
+        TypeInfo eType = _exp.getType();
+        
+        // dataType = TypeConstants.numericType;
+        if (TypeResolver.isNumeric(eType) && !eType.getIsArray())
+        {
+            _dataType.copy(eType);
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+            
+            return true;
+        }
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
+     
+        return false;
+    }
+
+	public String getReferenceTypeName() throws SPLException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+    public String toString()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+
+        String str = "Abs("+ this._exp.toString() + ")";
+        	
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "toString");
+       
+        return str;
+    }
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/Abs.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message