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 [34/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/util/ExpressionUtility.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/ExpressionUtility.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/ExpressionUtility.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/ExpressionUtility.java Fri Jan 11 10:56:30 2008
@@ -1,919 +1,919 @@
-/*
- * 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.util;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.List;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.TimeZone;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.IllegalExpressionTypeException;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.expressions.impl.DateTime;
-import org.apache.imperius.util.PropertiesLoader;
-import org.apache.imperius.util.SPLLogger;
-import org.w3c.dom.Element;
-
-
-public class ExpressionUtility
-{
-    
-    private static String GMT = "GMT";
-    
-    private static int UTC_MULTIPLIER = 60000;
-    
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-    private static final String sourceClass="ExpressionUtility";
-    
-    
-    /**
-     * Returns 0 if the given <code>Object</code>s have equal values from the
-     * view-point of ACPL data types, and a nonzero integer otherwise. If the
-     * two given <code>Object</code>s cannot be compared to each other, then
-     * a <code>ClassCastException</code> is thrown.
-     * <p>
-     * 
-     * Furthermore, if the values of given <code>Object</code>s can be
-     * ordered, then a positive integer (or a negative integer, respectively) is
-     * returned if the value of first <code>Object</code> is greater than (or
-     * less than, respectively) than the value of the second <code>Object</code>.
-     * This code is intended to follow IEEE 754 guidelines if the given objects
-     * are non-arbitrary precision instances of <code>Number</code>.
-     * 
-     * @param o1
-     *            the first <code>Object</code> to be compared
-     * @param o2
-     *            the second <code>Object</code> to be compared
-     * @return an integer indicating the equality and possibly relative order of
-     *         specified arguments
-     * @throws ClassCastException
-     *             if the specified <code>Object</code>s cannot be compared
-     *             to each other.
-     */
-    public static int compare(Object o1, Object o2) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-        
-        // first take care of the case where either o1 or o2 is null.
-        if (o1 == null || o2 == null)
-        {
-            
-        }
-        /*
-         * In PMAC, we have the following data types: String, Boolean, Calendar,
-         * Numeric, CompositeData. Two objects of different datatypes cannot be
-         * compared to each other.
-         * 
-         * We cannot use a straightforward <code>Comparable</code> interface
-         * since Numeric represents five Java classes, Short, Integer, Long,
-         * Float, and Double and CompositeData and Boolean does not implement
-         * <code>Comparable</code>.
-         */
-        // take care of a simple datatypes that implement
-        // <code>Comparable</code>
-        if (o1 instanceof String)
-        {
-            return ((Comparable) o1).compareTo(o2);
-        }
-        
-        // Calendar has to use After/Before
-        if (o1 instanceof Calendar)
-        {
-            Calendar o1cal = (Calendar) o1;
-            Calendar o2cal = (Calendar) o2;
-            if (o1cal.after(o2cal))
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                return 1;
-            }
-            else if (o2cal.after(o1cal))
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                return -1;
-            }
-            else
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                return 0;
-            }
-            
-        }
-        
-        // take care of two datatypes that are not ordered
-        if (o1 instanceof Boolean)
-        {
-            if (o1.equals(o2))
-            {
-
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                return 0;
-           
-            }
-                
-            else
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                return -1;
-            }
-        }
-        
-        // take care of Numeric dataypes
-        /*
-         * Cannot convert short, int, and long to double since there is a
-         * precision loss in those conversions, that is when comparing two longs
-         * after converting them to double, they may come out to be equal even
-         * if they are not.
-         */
-        boolean isFirstObjectInteger = false;
-        boolean isSecondObjectInteger = false;
-        // check for byte class also just in case, it is included in Numeric
-        // datatypes in future
-        if (o1 instanceof Byte || o1 instanceof Short || o1 instanceof Integer
-                || o1 instanceof Long)
-        {
-            isFirstObjectInteger = true;
-        }
-        if (o2 instanceof Byte || o2 instanceof Short || o2 instanceof Integer
-                || o2 instanceof Long)
-        {
-            isSecondObjectInteger = true;
-        }
-        
-        if (isFirstObjectInteger)
-        {
-            if (isSecondObjectInteger)
-            {
-                // since both objects have integer values, we can perform
-                // integer arithmetic.
-                long firstValue = ((Number) o1).longValue();
-                long secondValue = ((Number) o2).longValue();
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                return (new Long(firstValue)).compareTo(new Long(secondValue));
-            }
-            else
-            {
-                /*
-                 * first is integer and second is floating point, the best bet
-                 * is to use comparison operators.
-                 */
-                long firstValue = ((Number) o1).longValue();
-                double secondValue = ((Number) o2).doubleValue();
-                if (firstValue > secondValue)
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                    return 1;
-                }
-                else if (firstValue < secondValue)
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    
-                    return -1;
-                }
-                else
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    
-                    return 0;
-                }
-                
-            }
-        }
-        else
-        {
-            if (isSecondObjectInteger)
-            {
-                /*
-                 * first is floating point and second is integer, the best bet
-                 * is to use comparison operators.
-                 */
-                double firstValue = ((Number) o1).doubleValue();
-                long secondValue = ((Number) o2).longValue();
-                if (firstValue > secondValue)
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    
-                    return 1;
-                }
-                else if (firstValue < secondValue)
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    
-                    
-                    return -1;
-                }
-                else
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    
-                    return 0;
-                }
-                
-            }
-            else
-            {
-                // both are floating point and we can use Double class to
-                // compare
-                double firstValue = ((Number) o1).doubleValue();
-                double secondValue = ((Number) o2).doubleValue();
-
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                return (new Double(firstValue)
-                        .compareTo(new Double(secondValue)));
-            }
-        }
-    }
-    
-    public static Number plus(Number o1, Number o2)
-            throws IllegalExpressionTypeException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "plus");
-        
-        Number[] o = new Number[2];
-        o[0] = o1;
-        o[1] = o2;
-        
-        int resolvedType = TypeResolver.resolveType(o);
-        
-        if (resolvedType == TypeConstants.doubleType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
-            
-            return new Double(o1.doubleValue() + o2.doubleValue());
-        }
-        else if (resolvedType == TypeConstants.floatType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
-            
-            // return new Float(o1.floatValue() + o2.floatValue());
-            return new Float(o1.floatValue() + o2.floatValue());
-        }
-        else if (resolvedType == TypeConstants.longType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
-            
-            return new Long(o1.longValue() + o2.longValue());
-        }
-        else if (resolvedType == TypeConstants.shortType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
-            
-            return new Long(o1.shortValue() + o2.shortValue());
-        }
-        else if (resolvedType == TypeConstants.byteType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
-            
-            return new Long(o1.byteValue() + o2.byteValue());
-        }
-        else
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
-            
-            return new Integer(o1.intValue() + o2.intValue());
-        }
-    }
-    
-    public static Number division(Number o1, Number o2) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "division");
-        
-        Number[] o = new Number[2];
-        o[0] = o1;
-        o[1] = o2;
-        
-        int resolvedType = TypeResolver.resolveType(o);
-        
-        if (resolvedType == TypeConstants.doubleType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
-            
-            return new Double(o1.doubleValue() / o2.doubleValue());
-        }
-        else if (resolvedType == TypeConstants.floatType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
-            
-            return new Double(o1.doubleValue() / o2.doubleValue());
-        }
-        else if (resolvedType == TypeConstants.longType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
-            
-            return new Double(o1.doubleValue() / o2.doubleValue());
-        }
-        else if (resolvedType == TypeConstants.intType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
-            
-            return new Double(o1.doubleValue() / o2.doubleValue());
-        }
-        else if (resolvedType == TypeConstants.shortType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
-            
-            return new Double(o1.doubleValue() / o2.doubleValue());
-        }
-        else if (resolvedType == TypeConstants.byteType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
-            
-            return new Double(o1.doubleValue() / o2.doubleValue());
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"wrong operand type.");
-            
-            throw new SPLException("wrong operand type.");
-        }
-    }
-    
-    public static Number multiplication(Number o1, Number o2)
-            throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
-        
-        Number[] o = new Number[2];
-        o[0] = o1;
-        o[1] = o2;
-        
-        int resolvedType = TypeResolver.resolveType(o);
-        
-        if (resolvedType == TypeConstants.doubleType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
-            
-            return new Double(o1.doubleValue() * o2.doubleValue());
-        }
-        else if (resolvedType == TypeConstants.floatType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
-            
-            return new Float(o1.floatValue() * o2.floatValue());
-        }
-        else if (resolvedType == TypeConstants.longType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
-            
-            return new Long(o1.longValue() * o2.longValue());
-        }
-        else if (resolvedType == TypeConstants.intType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
-            
-            return new Integer(o1.intValue() * o2.intValue());
-        }
-        else if (resolvedType == TypeConstants.shortType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
-            
-            return new Short((short) (o1.shortValue() * o2.shortValue()));
-        }
-        else if (resolvedType == TypeConstants.byteType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
-            
-            return new Byte((byte) (o1.byteValue() * o2.byteValue()));
-        }
-        else
-        { 
-            logger.severe(Thread.currentThread().getName()+" "+"wrong operand type.");
-        
-            throw new SPLException("wrong operand type.");
-        }
-        
-    }
-    
-    public static Number minus(Number o1, Number o2) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "minus");
-        
-        Number[] o = new Number[2];
-        o[0] = o1;
-        o[1] = o2;
-        
-        int resolvedType = TypeResolver.resolveType(o);
-        
-        if (resolvedType == TypeConstants.doubleType)
-        {
-            double result = o1.doubleValue() - o2.doubleValue();
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
-            
-            
-            return new Double(result);
-        }
-        else if (resolvedType == TypeConstants.floatType)
-        {
-            float result = o1.floatValue() - o2.floatValue();
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
-            
-            
-            return new Float(result);
-        }
-        else if (resolvedType == TypeConstants.longType)
-        {
-            long result = o1.longValue() - o2.longValue();
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
-            
-            
-            return new Long(result);
-        }
-        else if (resolvedType == TypeConstants.shortType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
-            
-            
-            return new Long(o1.shortValue() - o2.shortValue());
-        }
-        else if (resolvedType == TypeConstants.byteType)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
-            
-            
-            return new Long(o1.byteValue() - o2.byteValue());
-        }
-        else
-        {
-            int result = o1.intValue() - o2.intValue();
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
-            
-            
-            return new Integer(result);
-        }
-    }
-    
-    /*
-     * public static int getTypeOfOperationForCollections(String operation)
-     * throws CIMSPLException { int LOR = 52; int LAND = 53; int BXOR = 54; int
-     * NOT_EQUAL = 55; int EQUAL = 56; int LT = 102; int GT = 58; int LE = 59;
-     * int GE = 60; int PLUS = 61; int MINUS = 62; int STAR = 63; int DIV = 64;
-     * 
-     * 
-     * String stringLOR = "LOR"; String stringLAND = "LAND"; String stringBXOR =
-     * "BXOR";
-     * 
-     * String stringNOT_EQUAL = "NOT_EQUAL"; String stringEQUAL = "EQUAL";
-     * String stringLT = "LT"; String stringGT = "GT"; String stringLE = "LE";
-     * String stringGE = "GE"; String stringPLUS = "PLUS"; String stringMINUS =
-     * "MINUS"; String stringSTAR = "STAR"; String stringDIV = "DIV";
-     * 
-     * 
-     * if(operation.equalsIgnoreCase(stringLOR)) return LOR; else
-     * if(operation.equalsIgnoreCase(stringLAND)) return LAND; else
-     * if(operation.equalsIgnoreCase(stringBXOR)) return BXOR; else
-     * if(operation.equalsIgnoreCase(stringNOT_EQUAL)) return NOT_EQUAL; else
-     * if(operation.equalsIgnoreCase(stringEQUAL)) return EQUAL; else
-     * if(operation.equalsIgnoreCase(stringLT)) return LT; else
-     * if(operation.equalsIgnoreCase(stringGT)) return GT; else
-     * if(operation.equalsIgnoreCase(stringLE)) return LE; else
-     * if(operation.equalsIgnoreCase(stringGE)) return GE; else
-     * if(operation.equalsIgnoreCase(stringPLUS)) return PLUS; else
-     * if(operation.equalsIgnoreCase(stringMINUS)) return MINUS; else
-     * if(operation.equalsIgnoreCase(stringSTAR)) return STAR; else
-     * if(operation.equalsIgnoreCase(stringDIV)) return DIV;
-     * 
-     * else { throw new CIMSPLException("Operation for Collection could not be
-     * resolved "+operation); }
-     * 
-     *  }
-     */
-
-      
-    
-    
-   
-
-    
-    private static List _getClassList(String type)
-    {
-    	List customClassList = new ArrayList();
-    	PropertiesLoader propLoader = new PropertiesLoader();
-    	Properties props = propLoader.getProperties();
-    	String exprList = props.getProperty(type);
-    	StringTokenizer st = new StringTokenizer(exprList,",");
-    	while(st.hasMoreTokens())
-    	{
-    		String customClass = st.nextToken();
-    		customClassList.add(customClass);
-    	}
-    	
-    	
-    	return customClassList;
-    	
-    }
-    
-    public static List getListOfCustomExpressionTypes()
-    {
-    	List customExprList = null;
-    	customExprList = _getClassList("SPL_CUSTOM_EXPRESSIONS");
-    	return customExprList;
-    }
-    
-    public static List getListOfCustomActionTypes()
-    {
-    	List customActionList = new ArrayList();
-
-    	customActionList = _getClassList("SPL_CUSTOM_ACTIONS");
-    	return customActionList;
-    	
-    }
-    
-    /**
-     * Returns 0 if the given <code>Object</code>s have equal values from the
-     * view-point of ACPL data types, and a nonzero integer otherwise. If the
-     * two given <code>Object</code>s cannot be compared to each other, then
-     * a <code>ClassCastException</code> is thrown.
-     * <p>
-     * 
-     * Furthermore, if the values of given <code>Object</code>s can be
-     * ordered, then a positive integer (or a negative integer, respectively) is
-     * returned if the value of first <code>Object</code> is greater than (or
-     * less than, respectively) than the value of the second <code>Object</code>.
-     * This code is intended to follow IEEE 754 guidelines if the given objects
-     * are non-arbitrary precision instances of <code>Number</code>.
-     * 
-     * @param o1
-     *            the first <code>Object</code> to be compared
-     * @param o2
-     *            the second <code>Object</code> to be compared
-     * @return an integer indicating the equality and possibly relative order of
-     *         specified arguments
-     * @throws ClassCastException
-     *             if the specified <code>Object</code>s cannot be compared
-     *             to each other.
-     */
-    /*public static int compare(Object o1, Object o2) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-
-        
-        
-        // first take care of the case where either o1 or o2 is null.
-        if (o1 == null || o2 == null)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"null operand.");
-            throw new SPLException("null operand.");
-        }
-        
-        // take care of a simple datatypes that implement
-        // <code>Comparable</code>
-        if (o1 instanceof String)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-            return ((Comparable) o1).compareTo(o2);
-        }
-        
-        // Calendar has to use After/Before
-        if (o1 instanceof Calendar)
-        {
-            Calendar o1cal = (Calendar) o1;
-            Calendar o2cal = (Calendar) o2;
-            if (o1cal.after(o2cal))
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                return 1;
-            }
-            else if (o2cal.after(o1cal))
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                return -1;
-            }
-            else
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                return 0;
-            }
-            
-        }
-        
-        // take care of two datatypes that are not ordered
-        if (o1 instanceof Boolean || o1 instanceof Element)
-        {
-            if (o1.equals(o2))
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                return 0;
-            }
-                
-            else
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                return -1;
-            }
-        }
-        
-        // take care of Numeric dataypes
-        boolean isFirstObjectInteger = false;
-        boolean isSecondObjectInteger = false;
-        // check for byte class also just in case, it is included in Numeric
-        // datatypes in future
-        if (o1 instanceof Byte || o1 instanceof Short || o1 instanceof Integer
-                || o1 instanceof Long)
-        {
-            isFirstObjectInteger = true;
-        }
-        if (o2 instanceof Byte || o2 instanceof Short || o2 instanceof Integer
-                || o2 instanceof Long)
-        {
-            isSecondObjectInteger = true;
-        }
-        
-        if (isFirstObjectInteger)
-        {
-            if (isSecondObjectInteger)
-            {
-                // since both objects have integer values, we can perform
-                // integer arithmetic.
-                long firstValue = ((Number) o1).longValue();
-                long secondValue = ((Number) o2).longValue();
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                return (new Long(firstValue)).compareTo(new Long(secondValue));
-            }
-            else
-            {
-                /*
-                 * first is integer and second is floating point, the best bet
-                 * is to use comparison operators.
-                 
-                long firstValue = ((Number) o1).longValue();
-                double secondValue = ((Number) o2).doubleValue();
-                if (firstValue > secondValue)
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    
-                    return 1;
-                }
-                    
-                else if (firstValue < secondValue)
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    return -1;
-                }
-                    
-                else
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    return 0;
-                }
-                
-            }
-        }
-        else
-        {
-            if (isSecondObjectInteger)
-            {
-                /*
-                 * first is floating point and second is integer, the best bet
-                 * is to use comparison operators.
-                 
-                double firstValue = ((Number) o1).doubleValue();
-                long secondValue = ((Number) o2).longValue();
-                if (firstValue > secondValue)
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    return 1;
-                    
-                }
-                    
-                else if (firstValue < secondValue)
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    
-                    return -1;
-                }
-                else
-                {
-                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                    
-                    return 0;
-                }
-                
-            }
-            else
-            {
-                // both are floating point and we can use Double class to
-                // compare
-                double firstValue = ((Number) o1).doubleValue();
-                double secondValue = ((Number) o2).doubleValue();
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
-                
-                return (new Double(firstValue)
-                        .compareTo(new Double(secondValue)));
-            }
-        }
-    }*/
-    
-    /**
-     * 
-     * This function converts a <code>DateTime</code> to a
-     * <code>Calendar</code> expression using the time zone specified by
-     * <code>timeZoneID</code>, which can be any of the defined Java TimeZone
-     * ID's, "utc", or "local". If <code>timeZoneID</code> is
-     * <code>null</code>, then "utc" is assumed. If isLenient is true, then
-     * the xsd:dateTime will be converted using the Calendar isLenient feature.
-     * Otherewise, an exception will be thrown if the time is not a valid time.
-     * If preferStandardTime is true, standard time will be chosen when there is
-     * an ambiguity (as in the "fall back" hour).
-     * <p>
-     * 
-     * If any of year, month, or day are 0 in the DateTime, then the current
-     * year, month, or day are substituted.
-     * <p>
-     * 
-     * The timeZone information contained in the DateTime is ignored.
-     * 
-     * @param isLenientValue
-     * @param preferStandardTimeValue
-     * @param spldate
-     *            iso8601 formatted date
-     * @param timeZoneID
-     * @return
-     */
-    public static Calendar computeCalendarValue(boolean isLenientValue,
-            boolean preferStandardTimeValue, DateTime spldate)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "computeCalendarValue");
-
-        String timeZoneID = spldate.getTimeZoneString();
-        
-        TimeZone tz = null;
-        
-        if (timeZoneID == null || timeZoneID.equalsIgnoreCase("utc"))
-        {
-            tz = TimeZone.getTimeZone("UTC");
-        }
-        else if (timeZoneID.equalsIgnoreCase("local"))
-        {
-            tz = TimeZone.getDefault();
-        }
-        else
-        {
-            tz = TimeZone.getTimeZone(timeZoneID);
-        }
-        
-        Calendar now = new GregorianCalendar(tz);
-        now.getTime();
-        
-        Calendar calendar = new GregorianCalendar(tz);
-        
-        calendar.setLenient(isLenientValue);
-        
-        if (spldate.isEraAD())
-        {
-            calendar.set(Calendar.ERA, GregorianCalendar.AD);
-        }
-        else
-        {
-            calendar.set(Calendar.ERA, GregorianCalendar.BC);
-        }
-        if (spldate.getYear() == -1)
-        {
-            calendar.set(Calendar.YEAR, now.get(Calendar.YEAR));
-        }
-        else
-        {
-            calendar.set(Calendar.YEAR, spldate.getYear());
-        }
-        if (spldate.getMonth() == -1)
-        {
-            calendar.set(Calendar.MONTH, now.get(Calendar.MONTH));
-        }
-        else
-        {
-            calendar.set(Calendar.MONTH, spldate.getMonth());
-        }
-        if (spldate.getDay() == -1)
-        {
-            calendar.set(Calendar.DATE, now.get(Calendar.DATE));
-        }
-        else
-        {
-            calendar.set(Calendar.DATE, spldate.getDay());
-        }
-        if (spldate.getHour() == -1)
-        {
-            calendar.set(Calendar.HOUR_OF_DAY, now.get(Calendar.HOUR_OF_DAY));
-        }
-        else
-        {
-            calendar.set(Calendar.HOUR_OF_DAY, spldate.getHour());
-        }
-        if (spldate.getMinute() == -1)
-        {
-            calendar.set(Calendar.MINUTE, now.get(Calendar.MINUTE));
-            //System.out.println("spldate.getMinute()"+spldate.getMinute());
-        }
-        else
-        {
-            calendar.set(Calendar.MINUTE, spldate.getMinute());
-            //System.out.println("spldate.getMinute()"+spldate.getMinute());
-        }
-        if (spldate.getSecond() == -1)
-        {
-            calendar.set(Calendar.SECOND, now.get(Calendar.SECOND));
-        }
-        else
-        {
-            calendar.set(Calendar.SECOND, spldate.getSecond());
-        }
-        if (spldate.getMillis() == -1)
-        {
-            calendar.set(Calendar.MILLISECOND, now.get(Calendar.MILLISECOND));
-        }
-        else
-        {
-            calendar.set(Calendar.MILLISECOND, spldate.getMillis());
-        }
-        //System.out.println(" calendar "+calendar.getTime().toString());
-        
-        /*
-         * If we are on the cusp of daylight /standard savings time, there can
-         * be ambiguity in the xsd:dateTime ("fall back period" We use the
-         * preferStandardTime to determine if we should use the first instance
-         * of a wall clock time or the second instance of a wall clock time
-         * during this period (for example, in some areas at 2:00am wallclock
-         * during daylight savings time, the time becomes 1:00am wallclock in
-         * standard time -- 1:30am wallclock appears twice in that day).
-         * 
-         * By default, Java takes the any time that has ambiguities as standard
-         * time, so we only need to check for the case when we don't prefer
-         * standard time.
-         */
-        if (!preferStandardTimeValue && tz.useDaylightTime())
-        {
-            // only relevant if we prefer daylight savings on
-            // ambiguities and if the time zone supports daylight savings
-            
-            int dstoffsetMillis = calendar
-                    .getActualMaximum(Calendar.DST_OFFSET);
-            
-            java.util.Date calendarDate = calendar.getTime();
-            // case we are concerned about is "Fall back" where we are in
-            // daylight savings time, but then fall back for standard savings --
-            // this
-            // causes the same wall clock time to appear twice
-            
-            /*
-             * To determine this, if we are in STD time, we need to substract
-             * DST_OFFSET from the current calendar and see if the time is in
-             * DST time -- if so we use that version
-             */
-            if (!tz.inDaylightTime(calendarDate))
-            {
-                // see if substracting the offset puts us in Daylight savings
-                
-                Date dateMinusDSTOffset = new Date(calendarDate.getTime()
-                        - dstoffsetMillis);
-                
-                if (tz.inDaylightTime(dateMinusDSTOffset))
-                {
-                    // subtracting the offset put us in daylight savings,
-                    // and we prefer the daylight savings instant of the date
-                    // so we will use this date
-                    calendar.setTime(dateMinusDSTOffset);
-                }
-            }
-            
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "computeCalendarValue");
-        //System.out.println(" calendar "+calendar.getTimeInMillis());
-        return calendar;
-    }
-    
-    public static void main(String [] args)
-    {
-    	List stList = getListOfCustomExpressionTypes();
-    	
-    }
-    
-}
+/*
+ * 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.util;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.TimeZone;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.IllegalExpressionTypeException;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.expressions.impl.DateTime;
+import org.apache.imperius.util.PropertiesLoader;
+import org.apache.imperius.util.SPLLogger;
+import org.w3c.dom.Element;
+
+
+public class ExpressionUtility
+{
+    
+    private static String GMT = "GMT";
+    
+    private static int UTC_MULTIPLIER = 60000;
+    
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+    private static final String sourceClass="ExpressionUtility";
+    
+    
+    /**
+     * Returns 0 if the given <code>Object</code>s have equal values from the
+     * view-point of ACPL data types, and a nonzero integer otherwise. If the
+     * two given <code>Object</code>s cannot be compared to each other, then
+     * a <code>ClassCastException</code> is thrown.
+     * <p>
+     * 
+     * Furthermore, if the values of given <code>Object</code>s can be
+     * ordered, then a positive integer (or a negative integer, respectively) is
+     * returned if the value of first <code>Object</code> is greater than (or
+     * less than, respectively) than the value of the second <code>Object</code>.
+     * This code is intended to follow IEEE 754 guidelines if the given objects
+     * are non-arbitrary precision instances of <code>Number</code>.
+     * 
+     * @param o1
+     *            the first <code>Object</code> to be compared
+     * @param o2
+     *            the second <code>Object</code> to be compared
+     * @return an integer indicating the equality and possibly relative order of
+     *         specified arguments
+     * @throws ClassCastException
+     *             if the specified <code>Object</code>s cannot be compared
+     *             to each other.
+     */
+    public static int compare(Object o1, Object o2) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+        
+        // first take care of the case where either o1 or o2 is null.
+        if (o1 == null || o2 == null)
+        {
+            
+        }
+        /*
+         * In PMAC, we have the following data types: String, Boolean, Calendar,
+         * Numeric, CompositeData. Two objects of different datatypes cannot be
+         * compared to each other.
+         * 
+         * We cannot use a straightforward <code>Comparable</code> interface
+         * since Numeric represents five Java classes, Short, Integer, Long,
+         * Float, and Double and CompositeData and Boolean does not implement
+         * <code>Comparable</code>.
+         */
+        // take care of a simple datatypes that implement
+        // <code>Comparable</code>
+        if (o1 instanceof String)
+        {
+            return ((Comparable) o1).compareTo(o2);
+        }
+        
+        // Calendar has to use After/Before
+        if (o1 instanceof Calendar)
+        {
+            Calendar o1cal = (Calendar) o1;
+            Calendar o2cal = (Calendar) o2;
+            if (o1cal.after(o2cal))
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                return 1;
+            }
+            else if (o2cal.after(o1cal))
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                return -1;
+            }
+            else
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                return 0;
+            }
+            
+        }
+        
+        // take care of two datatypes that are not ordered
+        if (o1 instanceof Boolean)
+        {
+            if (o1.equals(o2))
+            {
+
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                return 0;
+           
+            }
+                
+            else
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                return -1;
+            }
+        }
+        
+        // take care of Numeric dataypes
+        /*
+         * Cannot convert short, int, and long to double since there is a
+         * precision loss in those conversions, that is when comparing two longs
+         * after converting them to double, they may come out to be equal even
+         * if they are not.
+         */
+        boolean isFirstObjectInteger = false;
+        boolean isSecondObjectInteger = false;
+        // check for byte class also just in case, it is included in Numeric
+        // datatypes in future
+        if (o1 instanceof Byte || o1 instanceof Short || o1 instanceof Integer
+                || o1 instanceof Long)
+        {
+            isFirstObjectInteger = true;
+        }
+        if (o2 instanceof Byte || o2 instanceof Short || o2 instanceof Integer
+                || o2 instanceof Long)
+        {
+            isSecondObjectInteger = true;
+        }
+        
+        if (isFirstObjectInteger)
+        {
+            if (isSecondObjectInteger)
+            {
+                // since both objects have integer values, we can perform
+                // integer arithmetic.
+                long firstValue = ((Number) o1).longValue();
+                long secondValue = ((Number) o2).longValue();
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                return (new Long(firstValue)).compareTo(new Long(secondValue));
+            }
+            else
+            {
+                /*
+                 * first is integer and second is floating point, the best bet
+                 * is to use comparison operators.
+                 */
+                long firstValue = ((Number) o1).longValue();
+                double secondValue = ((Number) o2).doubleValue();
+                if (firstValue > secondValue)
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                    return 1;
+                }
+                else if (firstValue < secondValue)
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    
+                    return -1;
+                }
+                else
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    
+                    return 0;
+                }
+                
+            }
+        }
+        else
+        {
+            if (isSecondObjectInteger)
+            {
+                /*
+                 * first is floating point and second is integer, the best bet
+                 * is to use comparison operators.
+                 */
+                double firstValue = ((Number) o1).doubleValue();
+                long secondValue = ((Number) o2).longValue();
+                if (firstValue > secondValue)
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    
+                    return 1;
+                }
+                else if (firstValue < secondValue)
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    
+                    
+                    return -1;
+                }
+                else
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    
+                    return 0;
+                }
+                
+            }
+            else
+            {
+                // both are floating point and we can use Double class to
+                // compare
+                double firstValue = ((Number) o1).doubleValue();
+                double secondValue = ((Number) o2).doubleValue();
+
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                return (new Double(firstValue)
+                        .compareTo(new Double(secondValue)));
+            }
+        }
+    }
+    
+    public static Number plus(Number o1, Number o2)
+            throws IllegalExpressionTypeException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "plus");
+        
+        Number[] o = new Number[2];
+        o[0] = o1;
+        o[1] = o2;
+        
+        int resolvedType = TypeResolver.resolveType(o);
+        
+        if (resolvedType == TypeConstants.doubleType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
+            
+            return new Double(o1.doubleValue() + o2.doubleValue());
+        }
+        else if (resolvedType == TypeConstants.floatType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
+            
+            // return new Float(o1.floatValue() + o2.floatValue());
+            return new Float(o1.floatValue() + o2.floatValue());
+        }
+        else if (resolvedType == TypeConstants.longType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
+            
+            return new Long(o1.longValue() + o2.longValue());
+        }
+        else if (resolvedType == TypeConstants.shortType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
+            
+            return new Long(o1.shortValue() + o2.shortValue());
+        }
+        else if (resolvedType == TypeConstants.byteType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
+            
+            return new Long(o1.byteValue() + o2.byteValue());
+        }
+        else
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "plus");
+            
+            return new Integer(o1.intValue() + o2.intValue());
+        }
+    }
+    
+    public static Number division(Number o1, Number o2) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "division");
+        
+        Number[] o = new Number[2];
+        o[0] = o1;
+        o[1] = o2;
+        
+        int resolvedType = TypeResolver.resolveType(o);
+        
+        if (resolvedType == TypeConstants.doubleType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
+            
+            return new Double(o1.doubleValue() / o2.doubleValue());
+        }
+        else if (resolvedType == TypeConstants.floatType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
+            
+            return new Double(o1.doubleValue() / o2.doubleValue());
+        }
+        else if (resolvedType == TypeConstants.longType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
+            
+            return new Double(o1.doubleValue() / o2.doubleValue());
+        }
+        else if (resolvedType == TypeConstants.intType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
+            
+            return new Double(o1.doubleValue() / o2.doubleValue());
+        }
+        else if (resolvedType == TypeConstants.shortType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
+            
+            return new Double(o1.doubleValue() / o2.doubleValue());
+        }
+        else if (resolvedType == TypeConstants.byteType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "division");
+            
+            return new Double(o1.doubleValue() / o2.doubleValue());
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"wrong operand type.");
+            
+            throw new SPLException("wrong operand type.");
+        }
+    }
+    
+    public static Number multiplication(Number o1, Number o2)
+            throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
+        
+        Number[] o = new Number[2];
+        o[0] = o1;
+        o[1] = o2;
+        
+        int resolvedType = TypeResolver.resolveType(o);
+        
+        if (resolvedType == TypeConstants.doubleType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
+            
+            return new Double(o1.doubleValue() * o2.doubleValue());
+        }
+        else if (resolvedType == TypeConstants.floatType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
+            
+            return new Float(o1.floatValue() * o2.floatValue());
+        }
+        else if (resolvedType == TypeConstants.longType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
+            
+            return new Long(o1.longValue() * o2.longValue());
+        }
+        else if (resolvedType == TypeConstants.intType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
+            
+            return new Integer(o1.intValue() * o2.intValue());
+        }
+        else if (resolvedType == TypeConstants.shortType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
+            
+            return new Short((short) (o1.shortValue() * o2.shortValue()));
+        }
+        else if (resolvedType == TypeConstants.byteType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "multiplication");
+            
+            return new Byte((byte) (o1.byteValue() * o2.byteValue()));
+        }
+        else
+        { 
+            logger.severe(Thread.currentThread().getName()+" "+"wrong operand type.");
+        
+            throw new SPLException("wrong operand type.");
+        }
+        
+    }
+    
+    public static Number minus(Number o1, Number o2) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+        
+        Number[] o = new Number[2];
+        o[0] = o1;
+        o[1] = o2;
+        
+        int resolvedType = TypeResolver.resolveType(o);
+        
+        if (resolvedType == TypeConstants.doubleType)
+        {
+            double result = o1.doubleValue() - o2.doubleValue();
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            
+            return new Double(result);
+        }
+        else if (resolvedType == TypeConstants.floatType)
+        {
+            float result = o1.floatValue() - o2.floatValue();
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            
+            return new Float(result);
+        }
+        else if (resolvedType == TypeConstants.longType)
+        {
+            long result = o1.longValue() - o2.longValue();
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            
+            return new Long(result);
+        }
+        else if (resolvedType == TypeConstants.shortType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            
+            return new Long(o1.shortValue() - o2.shortValue());
+        }
+        else if (resolvedType == TypeConstants.byteType)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            
+            return new Long(o1.byteValue() - o2.byteValue());
+        }
+        else
+        {
+            int result = o1.intValue() - o2.intValue();
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "minus");
+            
+            
+            return new Integer(result);
+        }
+    }
+    
+    /*
+     * public static int getTypeOfOperationForCollections(String operation)
+     * throws CIMSPLException { int LOR = 52; int LAND = 53; int BXOR = 54; int
+     * NOT_EQUAL = 55; int EQUAL = 56; int LT = 102; int GT = 58; int LE = 59;
+     * int GE = 60; int PLUS = 61; int MINUS = 62; int STAR = 63; int DIV = 64;
+     * 
+     * 
+     * String stringLOR = "LOR"; String stringLAND = "LAND"; String stringBXOR =
+     * "BXOR";
+     * 
+     * String stringNOT_EQUAL = "NOT_EQUAL"; String stringEQUAL = "EQUAL";
+     * String stringLT = "LT"; String stringGT = "GT"; String stringLE = "LE";
+     * String stringGE = "GE"; String stringPLUS = "PLUS"; String stringMINUS =
+     * "MINUS"; String stringSTAR = "STAR"; String stringDIV = "DIV";
+     * 
+     * 
+     * if(operation.equalsIgnoreCase(stringLOR)) return LOR; else
+     * if(operation.equalsIgnoreCase(stringLAND)) return LAND; else
+     * if(operation.equalsIgnoreCase(stringBXOR)) return BXOR; else
+     * if(operation.equalsIgnoreCase(stringNOT_EQUAL)) return NOT_EQUAL; else
+     * if(operation.equalsIgnoreCase(stringEQUAL)) return EQUAL; else
+     * if(operation.equalsIgnoreCase(stringLT)) return LT; else
+     * if(operation.equalsIgnoreCase(stringGT)) return GT; else
+     * if(operation.equalsIgnoreCase(stringLE)) return LE; else
+     * if(operation.equalsIgnoreCase(stringGE)) return GE; else
+     * if(operation.equalsIgnoreCase(stringPLUS)) return PLUS; else
+     * if(operation.equalsIgnoreCase(stringMINUS)) return MINUS; else
+     * if(operation.equalsIgnoreCase(stringSTAR)) return STAR; else
+     * if(operation.equalsIgnoreCase(stringDIV)) return DIV;
+     * 
+     * else { throw new CIMSPLException("Operation for Collection could not be
+     * resolved "+operation); }
+     * 
+     *  }
+     */
+
+      
+    
+    
+   
+
+    
+    private static List _getClassList(String type)
+    {
+    	List customClassList = new ArrayList();
+    	PropertiesLoader propLoader = new PropertiesLoader();
+    	Properties props = propLoader.getProperties();
+    	String exprList = props.getProperty(type);
+    	StringTokenizer st = new StringTokenizer(exprList,",");
+    	while(st.hasMoreTokens())
+    	{
+    		String customClass = st.nextToken();
+    		customClassList.add(customClass);
+    	}
+    	
+    	
+    	return customClassList;
+    	
+    }
+    
+    public static List getListOfCustomExpressionTypes()
+    {
+    	List customExprList = null;
+    	customExprList = _getClassList("SPL_CUSTOM_EXPRESSIONS");
+    	return customExprList;
+    }
+    
+    public static List getListOfCustomActionTypes()
+    {
+    	List customActionList = new ArrayList();
+
+    	customActionList = _getClassList("SPL_CUSTOM_ACTIONS");
+    	return customActionList;
+    	
+    }
+    
+    /**
+     * Returns 0 if the given <code>Object</code>s have equal values from the
+     * view-point of ACPL data types, and a nonzero integer otherwise. If the
+     * two given <code>Object</code>s cannot be compared to each other, then
+     * a <code>ClassCastException</code> is thrown.
+     * <p>
+     * 
+     * Furthermore, if the values of given <code>Object</code>s can be
+     * ordered, then a positive integer (or a negative integer, respectively) is
+     * returned if the value of first <code>Object</code> is greater than (or
+     * less than, respectively) than the value of the second <code>Object</code>.
+     * This code is intended to follow IEEE 754 guidelines if the given objects
+     * are non-arbitrary precision instances of <code>Number</code>.
+     * 
+     * @param o1
+     *            the first <code>Object</code> to be compared
+     * @param o2
+     *            the second <code>Object</code> to be compared
+     * @return an integer indicating the equality and possibly relative order of
+     *         specified arguments
+     * @throws ClassCastException
+     *             if the specified <code>Object</code>s cannot be compared
+     *             to each other.
+     */
+    /*public static int compare(Object o1, Object o2) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+
+        
+        
+        // first take care of the case where either o1 or o2 is null.
+        if (o1 == null || o2 == null)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"null operand.");
+            throw new SPLException("null operand.");
+        }
+        
+        // take care of a simple datatypes that implement
+        // <code>Comparable</code>
+        if (o1 instanceof String)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+            return ((Comparable) o1).compareTo(o2);
+        }
+        
+        // Calendar has to use After/Before
+        if (o1 instanceof Calendar)
+        {
+            Calendar o1cal = (Calendar) o1;
+            Calendar o2cal = (Calendar) o2;
+            if (o1cal.after(o2cal))
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                return 1;
+            }
+            else if (o2cal.after(o1cal))
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                return -1;
+            }
+            else
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                return 0;
+            }
+            
+        }
+        
+        // take care of two datatypes that are not ordered
+        if (o1 instanceof Boolean || o1 instanceof Element)
+        {
+            if (o1.equals(o2))
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                return 0;
+            }
+                
+            else
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                return -1;
+            }
+        }
+        
+        // take care of Numeric dataypes
+        boolean isFirstObjectInteger = false;
+        boolean isSecondObjectInteger = false;
+        // check for byte class also just in case, it is included in Numeric
+        // datatypes in future
+        if (o1 instanceof Byte || o1 instanceof Short || o1 instanceof Integer
+                || o1 instanceof Long)
+        {
+            isFirstObjectInteger = true;
+        }
+        if (o2 instanceof Byte || o2 instanceof Short || o2 instanceof Integer
+                || o2 instanceof Long)
+        {
+            isSecondObjectInteger = true;
+        }
+        
+        if (isFirstObjectInteger)
+        {
+            if (isSecondObjectInteger)
+            {
+                // since both objects have integer values, we can perform
+                // integer arithmetic.
+                long firstValue = ((Number) o1).longValue();
+                long secondValue = ((Number) o2).longValue();
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                return (new Long(firstValue)).compareTo(new Long(secondValue));
+            }
+            else
+            {
+                /*
+                 * first is integer and second is floating point, the best bet
+                 * is to use comparison operators.
+                 
+                long firstValue = ((Number) o1).longValue();
+                double secondValue = ((Number) o2).doubleValue();
+                if (firstValue > secondValue)
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    
+                    return 1;
+                }
+                    
+                else if (firstValue < secondValue)
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    return -1;
+                }
+                    
+                else
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    return 0;
+                }
+                
+            }
+        }
+        else
+        {
+            if (isSecondObjectInteger)
+            {
+                /*
+                 * first is floating point and second is integer, the best bet
+                 * is to use comparison operators.
+                 
+                double firstValue = ((Number) o1).doubleValue();
+                long secondValue = ((Number) o2).longValue();
+                if (firstValue > secondValue)
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    return 1;
+                    
+                }
+                    
+                else if (firstValue < secondValue)
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    
+                    return -1;
+                }
+                else
+                {
+                    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                    
+                    return 0;
+                }
+                
+            }
+            else
+            {
+                // both are floating point and we can use Double class to
+                // compare
+                double firstValue = ((Number) o1).doubleValue();
+                double secondValue = ((Number) o2).doubleValue();
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "compare");
+                
+                return (new Double(firstValue)
+                        .compareTo(new Double(secondValue)));
+            }
+        }
+    }*/
+    
+    /**
+     * 
+     * This function converts a <code>DateTime</code> to a
+     * <code>Calendar</code> expression using the time zone specified by
+     * <code>timeZoneID</code>, which can be any of the defined Java TimeZone
+     * ID's, "utc", or "local". If <code>timeZoneID</code> is
+     * <code>null</code>, then "utc" is assumed. If isLenient is true, then
+     * the xsd:dateTime will be converted using the Calendar isLenient feature.
+     * Otherewise, an exception will be thrown if the time is not a valid time.
+     * If preferStandardTime is true, standard time will be chosen when there is
+     * an ambiguity (as in the "fall back" hour).
+     * <p>
+     * 
+     * If any of year, month, or day are 0 in the DateTime, then the current
+     * year, month, or day are substituted.
+     * <p>
+     * 
+     * The timeZone information contained in the DateTime is ignored.
+     * 
+     * @param isLenientValue
+     * @param preferStandardTimeValue
+     * @param spldate
+     *            iso8601 formatted date
+     * @param timeZoneID
+     * @return
+     */
+    public static Calendar computeCalendarValue(boolean isLenientValue,
+            boolean preferStandardTimeValue, DateTime spldate)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "computeCalendarValue");
+
+        String timeZoneID = spldate.getTimeZoneString();
+        
+        TimeZone tz = null;
+        
+        if (timeZoneID == null || timeZoneID.equalsIgnoreCase("utc"))
+        {
+            tz = TimeZone.getTimeZone("UTC");
+        }
+        else if (timeZoneID.equalsIgnoreCase("local"))
+        {
+            tz = TimeZone.getDefault();
+        }
+        else
+        {
+            tz = TimeZone.getTimeZone(timeZoneID);
+        }
+        
+        Calendar now = new GregorianCalendar(tz);
+        now.getTime();
+        
+        Calendar calendar = new GregorianCalendar(tz);
+        
+        calendar.setLenient(isLenientValue);
+        
+        if (spldate.isEraAD())
+        {
+            calendar.set(Calendar.ERA, GregorianCalendar.AD);
+        }
+        else
+        {
+            calendar.set(Calendar.ERA, GregorianCalendar.BC);
+        }
+        if (spldate.getYear() == -1)
+        {
+            calendar.set(Calendar.YEAR, now.get(Calendar.YEAR));
+        }
+        else
+        {
+            calendar.set(Calendar.YEAR, spldate.getYear());
+        }
+        if (spldate.getMonth() == -1)
+        {
+            calendar.set(Calendar.MONTH, now.get(Calendar.MONTH));
+        }
+        else
+        {
+            calendar.set(Calendar.MONTH, spldate.getMonth());
+        }
+        if (spldate.getDay() == -1)
+        {
+            calendar.set(Calendar.DATE, now.get(Calendar.DATE));
+        }
+        else
+        {
+            calendar.set(Calendar.DATE, spldate.getDay());
+        }
+        if (spldate.getHour() == -1)
+        {
+            calendar.set(Calendar.HOUR_OF_DAY, now.get(Calendar.HOUR_OF_DAY));
+        }
+        else
+        {
+            calendar.set(Calendar.HOUR_OF_DAY, spldate.getHour());
+        }
+        if (spldate.getMinute() == -1)
+        {
+            calendar.set(Calendar.MINUTE, now.get(Calendar.MINUTE));
+            //System.out.println("spldate.getMinute()"+spldate.getMinute());
+        }
+        else
+        {
+            calendar.set(Calendar.MINUTE, spldate.getMinute());
+            //System.out.println("spldate.getMinute()"+spldate.getMinute());
+        }
+        if (spldate.getSecond() == -1)
+        {
+            calendar.set(Calendar.SECOND, now.get(Calendar.SECOND));
+        }
+        else
+        {
+            calendar.set(Calendar.SECOND, spldate.getSecond());
+        }
+        if (spldate.getMillis() == -1)
+        {
+            calendar.set(Calendar.MILLISECOND, now.get(Calendar.MILLISECOND));
+        }
+        else
+        {
+            calendar.set(Calendar.MILLISECOND, spldate.getMillis());
+        }
+        //System.out.println(" calendar "+calendar.getTime().toString());
+        
+        /*
+         * If we are on the cusp of daylight /standard savings time, there can
+         * be ambiguity in the xsd:dateTime ("fall back period" We use the
+         * preferStandardTime to determine if we should use the first instance
+         * of a wall clock time or the second instance of a wall clock time
+         * during this period (for example, in some areas at 2:00am wallclock
+         * during daylight savings time, the time becomes 1:00am wallclock in
+         * standard time -- 1:30am wallclock appears twice in that day).
+         * 
+         * By default, Java takes the any time that has ambiguities as standard
+         * time, so we only need to check for the case when we don't prefer
+         * standard time.
+         */
+        if (!preferStandardTimeValue && tz.useDaylightTime())
+        {
+            // only relevant if we prefer daylight savings on
+            // ambiguities and if the time zone supports daylight savings
+            
+            int dstoffsetMillis = calendar
+                    .getActualMaximum(Calendar.DST_OFFSET);
+            
+            java.util.Date calendarDate = calendar.getTime();
+            // case we are concerned about is "Fall back" where we are in
+            // daylight savings time, but then fall back for standard savings --
+            // this
+            // causes the same wall clock time to appear twice
+            
+            /*
+             * To determine this, if we are in STD time, we need to substract
+             * DST_OFFSET from the current calendar and see if the time is in
+             * DST time -- if so we use that version
+             */
+            if (!tz.inDaylightTime(calendarDate))
+            {
+                // see if substracting the offset puts us in Daylight savings
+                
+                Date dateMinusDSTOffset = new Date(calendarDate.getTime()
+                        - dstoffsetMillis);
+                
+                if (tz.inDaylightTime(dateMinusDSTOffset))
+                {
+                    // subtracting the offset put us in daylight savings,
+                    // and we prefer the daylight savings instant of the date
+                    // so we will use this date
+                    calendar.setTime(dateMinusDSTOffset);
+                }
+            }
+            
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "computeCalendarValue");
+        //System.out.println(" calendar "+calendar.getTimeInMillis());
+        return calendar;
+    }
+    
+    public static void main(String [] args)
+    {
+    	List stList = getListOfCustomExpressionTypes();
+    	
+    }
+    
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/InternalClientFactory.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/InternalClientFactory.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/InternalClientFactory.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/InternalClientFactory.java Fri Jan 11 10:56:30 2008
@@ -1,39 +1,39 @@
-/*
- * 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.util;
-
-import org.apache.imperius.spl.external.InternalClient;
-
-public class InternalClientFactory 
-{
-	private static InternalClient _internalClient;
-	
-	public static void registerInternalClient(InternalClient dc)
-	{
-		_internalClient = dc;
-	}
-	
-	public static InternalClient getInternalClient()
-	{
-		return _internalClient;
-	}
-
-}
+/*
+ * 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.util;
+
+import org.apache.imperius.spl.external.InternalClient;
+
+public class InternalClientFactory 
+{
+	private static InternalClient _internalClient;
+	
+	public static void registerInternalClient(InternalClient dc)
+	{
+		_internalClient = dc;
+	}
+	
+	public static InternalClient getInternalClient()
+	{
+		return _internalClient;
+	}
+
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/KeyStringToMapConvertor.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/KeyStringToMapConvertor.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/KeyStringToMapConvertor.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/KeyStringToMapConvertor.java Fri Jan 11 10:56:30 2008
@@ -1,111 +1,111 @@
-/*
- * 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.util;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.imperius.util.SPLLogger;
-
-
-public class KeyStringToMapConvertor
-{
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-    private static final String sourceClass="ExpressionUtility";
-    
-    
-    public static Map getMapOfKeys(String keyValues)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMapOfKeys");
-        
-        String keyString = keyValues;
-        if(logger.isLoggable(Level.FINE))
-            logger.fine(Thread.currentThread().getName()+"keyString "+keyString);
-        
-        //System.out.println("keyValues " + keyValues);
-        keyString = keyString.substring(keyString.indexOf('.') + 1);
-        Map keysMap = new HashMap();
-        if (keyString.startsWith("&&"))
-        {
-            keyString = keyString.substring(2);
-        }
-        while (keyString.indexOf('$') != -1)
-        {
-            String keyValue = "";
-            String keyName = keyString.substring(0, keyString.indexOf('$'));
-            //System.out.println(" keyString keyName keyValue " + keyString + " "+ keyName + " " + keyValue);
-            if (keyName.indexOf('.') != -1)
-            {
-                keyName = keyName.substring(keyName.indexOf('.') + 1);
-                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
-            }
-            keyName = keyName.trim().toLowerCase();
-            keyString = keyString.substring(keyString.indexOf('$') + 1);
-            //System.out.println(" keyString keyName keyValue " + keyString + " "+ keyName + " " + keyValue);
-            if (keyString.indexOf("&&") != -1)
-            {
-                keyValue = keyString.substring(0, keyString.indexOf("&&"));
-                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
-                keyString = keyString.substring(keyString.indexOf("&&") + 2);
-                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
-            }
-            else
-            {
-                keyValue = keyString;
-                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
-                keyString = "";
-                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
-            }
-            //System.out.println(" keyString keyName keyValue " + keyString + " "+ keyName + " " + keyValue);
-            //System.out.println("CIMObjectInstance  keyName: "+ keyName.toLowerCase() + "  keyValue : " + keyValue);
-            if(logger.isLoggable(Level.FINE))
-                logger.fine(Thread.currentThread().getName()+"keyName, keyValue "+keyName+ " , "+ keyValue);
-            
-            keysMap.put(keyName, keyValue);
-        }
-
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMapOfKeys");
-   
-        return keysMap;
-    }
-    
-    public static String KeyStringToClassName(String keyValues)
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "KeyStringToClassName");
-        
-        
-        String className = keyValues.substring(0, keyValues.indexOf('.'));
-        if (className != null)
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "KeyStringToClassName");
-            
-            return className;
-        }
-        else
-        {
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "KeyStringToClassName");
-            
-            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.util;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.imperius.util.SPLLogger;
+
+
+public class KeyStringToMapConvertor
+{
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+    private static final String sourceClass="ExpressionUtility";
+    
+    
+    public static Map getMapOfKeys(String keyValues)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getMapOfKeys");
+        
+        String keyString = keyValues;
+        if(logger.isLoggable(Level.FINE))
+            logger.fine(Thread.currentThread().getName()+"keyString "+keyString);
+        
+        //System.out.println("keyValues " + keyValues);
+        keyString = keyString.substring(keyString.indexOf('.') + 1);
+        Map keysMap = new HashMap();
+        if (keyString.startsWith("&&"))
+        {
+            keyString = keyString.substring(2);
+        }
+        while (keyString.indexOf('$') != -1)
+        {
+            String keyValue = "";
+            String keyName = keyString.substring(0, keyString.indexOf('$'));
+            //System.out.println(" keyString keyName keyValue " + keyString + " "+ keyName + " " + keyValue);
+            if (keyName.indexOf('.') != -1)
+            {
+                keyName = keyName.substring(keyName.indexOf('.') + 1);
+                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
+            }
+            keyName = keyName.trim().toLowerCase();
+            keyString = keyString.substring(keyString.indexOf('$') + 1);
+            //System.out.println(" keyString keyName keyValue " + keyString + " "+ keyName + " " + keyValue);
+            if (keyString.indexOf("&&") != -1)
+            {
+                keyValue = keyString.substring(0, keyString.indexOf("&&"));
+                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
+                keyString = keyString.substring(keyString.indexOf("&&") + 2);
+                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
+            }
+            else
+            {
+                keyValue = keyString;
+                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
+                keyString = "";
+                //System.out.println(" keyString keyName keyValue " + keyString+ " " + keyName + " " + keyValue);
+            }
+            //System.out.println(" keyString keyName keyValue " + keyString + " "+ keyName + " " + keyValue);
+            //System.out.println("CIMObjectInstance  keyName: "+ keyName.toLowerCase() + "  keyValue : " + keyValue);
+            if(logger.isLoggable(Level.FINE))
+                logger.fine(Thread.currentThread().getName()+"keyName, keyValue "+keyName+ " , "+ keyValue);
+            
+            keysMap.put(keyName, keyValue);
+        }
+
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getMapOfKeys");
+   
+        return keysMap;
+    }
+    
+    public static String KeyStringToClassName(String keyValues)
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "KeyStringToClassName");
+        
+        
+        String className = keyValues.substring(0, keyValues.indexOf('.'));
+        if (className != null)
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "KeyStringToClassName");
+            
+            return className;
+        }
+        else
+        {
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "KeyStringToClassName");
+            
+            return null;
+        }
+    }
+}

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

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/TypeInfo.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/TypeInfo.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/TypeInfo.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/util/TypeInfo.java Fri Jan 11 10:56:30 2008
@@ -1,102 +1,102 @@
-/*
- * 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.util;
-
-import org.apache.imperius.spl.external.TypeConstants;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-
-
-public class TypeInfo 
-{
-	private int _splType = TypeConstants.INVALID;
-	private String _referenceTypeName = null;
-	private boolean _isArray = false;
-	
-	
-	public TypeInfo()
-	{
-		
-		
-	}
-	public TypeInfo(int type)
-	{
-		_splType = type;
-		_referenceTypeName = null;
-		_isArray = false;
-	}
-	
-	public TypeInfo(TypeInfo type)
-	{
-		_splType = type.getType();
-		_referenceTypeName = type.getReferenceTypeName();
-		_isArray = type.getIsArray();
-	}
-		
-	public TypeInfo(int splType, String referenceTypeName, boolean isArr) throws SPLException
-	{
-		if(TypeResolver.isValidType(splType))
-		{	
-			_splType = splType;
-			_referenceTypeName = referenceTypeName;
-			_isArray = isArr;
-		}
-		else
-		{
-			throw new SPLException("invalid type" + splType);
-		}
-	}
-
-	public String getReferenceTypeName() {
-		return _referenceTypeName;
-	}
-
-	public void setReferenceTypeName(String typeName) {
-		_referenceTypeName = typeName;
-	}
-
-	public int getType() {
-		return _splType;
-	}
-
-	public void setType(int type) {
-		_splType = type;
-	}
-	
-	public boolean getIsArray() {
-		return _isArray;
-	}
-
-
-	public void setIsArray(boolean array) {
-		_isArray = array;
-	}
-	
-	public void copy(TypeInfo tp) 
-	{
-		_isArray = tp.getIsArray();
-		_splType = tp.getType();
-		_referenceTypeName = tp.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.util;
+
+import org.apache.imperius.spl.external.TypeConstants;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+
+
+public class TypeInfo 
+{
+	private int _splType = TypeConstants.INVALID;
+	private String _referenceTypeName = null;
+	private boolean _isArray = false;
+	
+	
+	public TypeInfo()
+	{
+		
+		
+	}
+	public TypeInfo(int type)
+	{
+		_splType = type;
+		_referenceTypeName = null;
+		_isArray = false;
+	}
+	
+	public TypeInfo(TypeInfo type)
+	{
+		_splType = type.getType();
+		_referenceTypeName = type.getReferenceTypeName();
+		_isArray = type.getIsArray();
+	}
+		
+	public TypeInfo(int splType, String referenceTypeName, boolean isArr) throws SPLException
+	{
+		if(TypeResolver.isValidType(splType))
+		{	
+			_splType = splType;
+			_referenceTypeName = referenceTypeName;
+			_isArray = isArr;
+		}
+		else
+		{
+			throw new SPLException("invalid type" + splType);
+		}
+	}
+
+	public String getReferenceTypeName() {
+		return _referenceTypeName;
+	}
+
+	public void setReferenceTypeName(String typeName) {
+		_referenceTypeName = typeName;
+	}
+
+	public int getType() {
+		return _splType;
+	}
+
+	public void setType(int type) {
+		_splType = type;
+	}
+	
+	public boolean getIsArray() {
+		return _isArray;
+	}
+
+
+	public void setIsArray(boolean array) {
+		_isArray = array;
+	}
+	
+	public void copy(TypeInfo tp) 
+	{
+		_isArray = tp.getIsArray();
+		_splType = tp.getType();
+		_referenceTypeName = tp.getReferenceTypeName();
+	}
+
+
+	
+
+}

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



Mime
View raw message