Package org.eclipse.jst.jsf.common.internal.types

Examples of org.eclipse.jst.jsf.common.internal.types.ValueType


            {
                // error: no point in validating further since expr will probably throw an exception
                return null;
            }
           
            return new ValueType(Signature.SIG_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
        }
       
        // JSP.2.3.5.6, step 10 -- otherwise, error
        return null;
View Full Code Here


        {
            return BooleanLiteralType.FALSE;
        }
       
        // otherwise, return a generic boolean type
        return new ValueType(TypeConstants.TYPE_BOOLEAN, type.getAssignability());
    }
View Full Code Here

                {
                    return null;
                }
            }
           
            return new ValueType(TypeConstants.TYPE_BIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
        }
        catch (TypeCoercionException ce)
        {
            return null;
        }
View Full Code Here

                        doRealOperation(new Double(firstValue.doubleValue())
                                , new Double(secondValue.doubleValue())).doubleValue());
            }

            // if not both literals and could coerce, then the type is double
            return new ValueType(Signature.SIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
        }
        catch (TypeCoercionException ce)
        {
            // could not coerce for the operation
            return null;
View Full Code Here

            }
           
            // if we get to here, we only know that both can be up cast to BigDecimal
            // and compared.  This will yield a boolean result
            // this value cannot be lhs
            return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
        }
        catch (TypeCoercionException tce)
        {
            // no valid coercion, so return null
            return null;
View Full Code Here

            boolean newValue = doRealOperation(firstValue, secondValue);
            return newValue ? BooleanLiteralType.TRUE : BooleanLiteralType.FALSE;
        }
       
        // if don't have all literals, just return boolean type
        return new ValueType(TypeConstants.TYPE_BOOLEAN, IAssignable.ASSIGNMENT_TYPE_RHS);
    }
View Full Code Here

            // JSP.2.3.5.4, step 2 if BigDecimal or BigInteger, then can't be
            // literal and retains type
            if (TypeConstants.TYPE_BIG_DOUBLE.equals(coercedType))
            {
                return new ValueType(TypeConstants.TYPE_BIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
            }
            else if (TypeConstants.TYPE_BIG_INTEGER.equals(coercedType))
            {
                return new ValueType(TypeConstants.TYPE_BIG_INTEGER, IAssignable.ASSIGNMENT_TYPE_RHS);
            }
           
            if (TypeCoercer.typeIsString(type.getSignature()))
            {
                // if it's string and we have the value, we can determine for
                // sure whether or not it's coercable to a number
                // per JSP.2.3.5.4 step 3
                if (type instanceof StringLiteralType)
                {
                    String literalValue = ((LiteralType)type).getLiteralValue();
                    if (literalValue.indexOf('.') > -1
                            || literalValue.indexOf('e') > -1
                            || literalValue.indexOf('E') > -1)
                    {
                        // if it coerces to double, then it's a double
                        Number value = ((LiteralType)type).coerceToNumber(Double.class);
                        return new FloatLiteralType(-1 * value.doubleValue());
                    }
   
                    // if it coerces to long, then it's a long
                    Number value = ((LiteralType)type).coerceToNumber(Long.class);
                    return new IntegerLiteralType(-1 * value.longValue());
                }
               
                // otherwise, just return a long typed value
                return new ValueType(Signature.SIG_LONG, IAssignable.ASSIGNMENT_TYPE_RHS);
            }
           
            // JSP.2.3.5.4
            // big integer and big decimal retain type
            // all numeric types retain type
View Full Code Here

                {
                    throw new AssertionError("coerce should not throw exception"); //$NON-NLS-1$
                }
            }
           
            return new ValueType(TypeConstants.TYPE_BOOLEAN, type.getAssignability());
        }
        return null;
    }
View Full Code Here

                                        new Double(secondValue.doubleValue())).doubleValue());
            }

            // if we get to here, the coercion is valid, so a Double will be
            // returned
            return new ValueType(Signature.SIG_DOUBLE, IAssignable.ASSIGNMENT_TYPE_RHS);
        }
        catch (TypeCoercionException tce)
        {
            // could not coerce, so null
            return null;
View Full Code Here

            }
           
            // since one of the args is BigInteger, they are not both literals,
            // so if we get to here, we have a successful mod of two
            // big integers to one big integer
            return new ValueType(TypeConstants.TYPE_BIG_INTEGER, IAssignable.ASSIGNMENT_TYPE_RHS);
        }
        catch (TypeCoercionException tce)
        {
            // no coercion
            return null;
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsf.common.internal.types.ValueType

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.