Package org.apache.imperius.spl.parser.exceptions

Examples of org.apache.imperius.spl.parser.exceptions.SPLException


        }
        catch (Exception e)
        {
            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
           
            throw new SPLException(Messages.getString(
          "SPL_EVALUATION_ERROR_MSG", new Object[] { e
              .getLocalizedMessage() }));

        }
    }
View Full Code Here


            if (!validate())
            {
                logger.severe(
                        "validation error: wrong data type passed in "
                        + this._dataType);
                throw new SPLException(Messages.getString(
              "SPL_VALIDATION_ERROR_MSG", new Object[] { className }));
            }
        }
       
        this._dataType.copy(this._exp.getType());
View Full Code Here

        Object max = null;
        Object expResult = this._exp.evaluate();
        if (!(expResult instanceof java.util.List))
        {
            logger.severe(Thread.currentThread().getName()+" "+"result of expression is not of type List");
            throw new SPLException(Messages.getString(
          "SPL_PASSED_EXPRESSION_TYPE_ERROR_MSG", new Object[] {
              "RHS", "is not", "List" }));
        }
        ArrayList resultArray = (ArrayList) expResult;
       //System.out.println("resultArray size " + resultArray.size()+ " to string " + resultArray.toString());
        ////System.out.println("resultArray is of type "+expression.getType());
        if ((resultArray != null) && (!resultArray.isEmpty()))
        {
            Iterator resultIt = resultArray.iterator();
            while (resultIt.hasNext())
            {
                Object resultObject = resultIt.next();
               //System.out.println("resultObject,class " + resultObject + " "+ resultObject.getClass());
                if (max == null)
                {
                    max = resultObject;
                }
               
                if (ExpressionUtility.compare(max, resultObject) < 0)
                {
                   //System.out.println("resultObject " + resultObject+ " is greater than max " + max+ "   so resetting max");
                    max = resultObject;
                }
                else
                {
                   //System.out.println("resultObject " + resultObject+ " max not reset" + max);
                   
                }
               
            }
           //System.out.println(max);
            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
           
            return max;
        }
        else
        {
            logger.severe(Thread.currentThread().getName()+" "+"result Array is empty");
            throw new SPLException(Messages.getString(
          "SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
          new Object[] { expResult }));
        }
       
    }
View Full Code Here

            if (!validate())
            {
                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
                        + " has wrong data type passed in.");
               
                throw new SPLException(Messages.getString(
              "SPL_VALIDATION_ERROR_MSG", new Object[] { className }));
            }
        }
        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "LogicalXor");
       
View Full Code Here

        }
        catch (Exception e)
        {
            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
           
            throw new SPLException(Messages.getString(
          "SPL_EVALUATION_ERROR_MSG", new Object[] { e
              .getLocalizedMessage() }));

        }
    }
View Full Code Here

                logger.severe(
                        "validation error: wrong data type passed in "
                        + this._dataType);
            
                throw new SPLException(Messages.getString(
              "SPL_VALIDATION_ERROR_MSG", new Object[] { className }));
            }
        }
       
        this._dataType.copy(this._exp.getType());
View Full Code Here

        Object sum = null;
        Object expResult = this._exp.evaluate();
        if (!(expResult instanceof java.util.List))
        {
            logger.severe(Thread.currentThread().getName()+" "+"result of expression is not of type List");
            throw new SPLException(Messages.getString(
          "SPL_NOT_REQUIRED_EXP_EXCEPTION_MSG",
          new Object[] { "List" }));
        }
        ArrayList resultArray = (ArrayList) expResult;
        Integer count = new Integer(resultArray.size());
       //System.out.println("resultArray size " + resultArray.size() + " to string " + resultArray.toString());
        ////System.out.println("resultArray is of type "+expression.getType());
        if ((resultArray != null) && (!resultArray.isEmpty()))
        {
            Iterator resultIt = resultArray.iterator();
            while (resultIt.hasNext())
            {
                Object resultObject = resultIt.next();
               //System.out.println("resultObject,class " + resultObject + " " + resultObject.getClass());
                if (sum == null)
                {
                    sum = resultObject;
                   
                }
                else
                {
                   //System.out .println("Adding resultObject to SdInCollection is " + resultObject + "  " + sum);
                    sum = ExpressionUtility.plus((Number) sum,
                            (Number) resultObject);
                }
                Object square = ExpressionUtility.multiplication(
                        (Number) resultObject, (Number) resultObject);
                if (squareSum == null)
                {
                    squareSum = square;
                   
                }
                else
                {
                   //System.out .println("Adding resultObject to SdInCollection is "+ resultObject + "  " + sum);
                    squareSum = ExpressionUtility.plus((Number) square,
                            (Number) squareSum);
                }
               
            }
            double mean = ((Number) sum).doubleValue() / resultArray.size();
            Number squareSumByCount = ExpressionUtility.division(
                    (Number) squareSum, (Number) count);
            Double meanSquare = new Double(mean * mean);
            Number subtractionResult = ExpressionUtility.minus(
                    squareSumByCount, (Number) meanSquare);
           //System.out.println("current SdInCollection is "+ Math.sqrt(subtractionResult.doubleValue()));
            Number result = new Double(Math.sqrt(subtractionResult.doubleValue()));
            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate" + result);
           
            return result;
           
        }
        else
        {

            logger.severe(Thread.currentThread().getName()+" "+"result Array is empty");
            throw new SPLException(Messages.getString(
          "SPL_BLANK_EXPRESSION_PASSED_ERROR_MSG",
          new Object[] { "expression" }));
        }
       
    }
View Full Code Here

            if (!validate())
            {
                logger.severe(Thread.currentThread().getName()+" "+"validation error: " + className
                        + " has wrong data type passed in.");
               
                throw new SPLException(Messages.getString(
              "SPL_VALIDATION_ERROR_MSG", new Object[] { className}));
            }
        }
        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "Division");
       
View Full Code Here

        }
        catch (Exception e)
        {
            logger.severe(Thread.currentThread().getName()+" "+"evaluation error: " + e.toString());
           
            throw new SPLException(Messages.getString(
          "SPL_EVALUATION_ERROR_MSG", new Object[] { e
              .getLocalizedMessage() }));

        }
    }
View Full Code Here

            }
            else
            {
                logger.severe(Thread.currentThread().getName()+" "+"denominator is zero  LHS="+o1+" RHS="+o2);
               
                throw new SPLException("denominator is zero  LHS="+o1+" RHS="+o2);
            }
           
        }
        else
        {
            logger.severe(Thread.currentThread().getName()+" "+"operand is null  LHS="+o1+" RHS="+o2);
           
            throw new SPLException("operand is null  LHS="+o1+" RHS="+o2);
        }
       
    }
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.parser.exceptions.SPLException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.