Package org.apache.imperius.spl.core

Examples of org.apache.imperius.spl.core.TypeInfo


        // case 2: ident1.ident2
        // case 3: ident1[expr]
        // case 4: ident1.ident2[expr]
        if(!_identTupleList.isEmpty())
        {
          TypeInfo returnType = new TypeInfoImpl(TypeConstants.referenceType,
              _classNameOrInstanceVariableName,
              isArray);
          int i = 0;
          Iterator identTupleIt = _identTupleList.iterator();
          while(identTupleIt.hasNext())
          {
            if(returnType.getType() == TypeConstants.referenceType)
            {
              String referenceTypeName = returnType.getReferenceTypeName();
              IdentPrimaryTuple ipt = (IdentPrimaryTuple)identTupleIt.next();
              if(i++ == 0) // first element in the list has the same symbol table
              { // as the primary expression
                ipt.setSymbolTable(_symTab);
              }
              returnType = ipt.validate(referenceTypeName);
            } else {
              identTupleIt.next()// <--- Added by dawood
           
          }
          _dataType.copy(returnType);
          //_isArray = returnType.getIsArray();
          _referenceTypeName = returnType.getReferenceTypeName();
        }
        else // local constant
        {
            boolean symbolExists = _symTab.symbolExists(_classNameOrInstanceVariableName, true);
            if( symbolExists )
View Full Code Here


   
    public boolean validate() throws SPLException
    {
        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");

        TypeInfo eType = _exp.getType();
        _dataType = new TypeInfoImpl(TypeConstants.stringType,null,false);
        if (TypeResolver.isString(eType))
        {
            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
          
View Full Code Here

   
    public boolean validate() throws SPLException
    {
        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");

        TypeInfo eType = _exp.getType();
       
       
        if (!eType.getIsArray() && TypeResolver.isCalendar(eType))
        {
            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
            _dataType.setType(TypeConstants.intType);
            return true;
        }
View Full Code Here

   
    public boolean validate() throws SPLException
    {
        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");

        TypeInfo lType = _lhsExp.getType();
        TypeInfo mType = _midExp.getType();
        TypeInfo rType = _rhsExp.getType();
       
        if (!lType.getIsArray() && !mType.getIsArray() &&
            !rType.getIsArray() && TypeResolver.isString(lType) &&
            (TypeResolver.isString(mType) || TypeResolver
                        .isNumeric(mType)) && TypeResolver.isString(rType))
        {
            _dataType.setType(TypeConstants.stringType);
            logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "validate");
View Full Code Here

   
    public static TypeInfo unaryNumericPromotionResolver(TypeInfo te)
            throws NullPointerException
    {
      int type = te.getType();
      TypeInfo retType = new TypeInfoImpl();
       
       
        if (type == TypeConstants.doubleType)
        {
          retType.setType(TypeConstants.doubleType);
           
            return retType;
        }
       
        if (type == TypeConstants.floatType)
        {
   
          retType.setType(TypeConstants.floatType);
            return retType;
        }
       
        if (type == TypeConstants.longType)
        {
          retType.setType(TypeConstants.longType);
           
            return retType;
        }

     
  
        // short byte char get converted to integer
        retType.setType(TypeConstants.intType);
        return retType;
    }
View Full Code Here

    {
        if (formalParams.size() == passedParams.size())
        {
            for (int i = 0; i < formalParams.size(); i++)
            {
              TypeInfo fParam = (TypeInfo) formalParams.get(i);
                Expression pParam = (Expression) passedParams.get(i);
               
                if (!TypeResolver.isTypeAssignableForEquality(
                        fParam, pParam.getType()))
                {
View Full Code Here

    logger.entering(sourceClass, Thread.currentThread().getName() + " "
        + "execute");

    Expression _lhsExp = null;
    Expression _rhsExp = null;
    TypeInfo lType = null;

//    try
//    {
      InternalClient internalClientObj = null;
      // System.out.println("parameters List " + _paramList);
      if (_paramList.size() == 0)
      {
        logger
            .severe("number of parameters passed to a InvokePolicyAction should be 2 or more");
        throw new SPLException(Messages.getString(
            "SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
                "2 or more", "0" }));
      }
      else
      {
        internalClientObj = InternalClientFactory.getInternalClient();
        _lhsExp = (Expression) _paramList.get(0);
        lType = _lhsExp.getType();
        if (lType.getType() != TypeConstants.stringType)
        {
          logger
              .severe("first Expression should be a string describing the name of the policy to invoke");
          throw new SPLException(
              Messages
View Full Code Here

   
    public boolean validate() throws SPLException
    {
        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");

        TypeInfo eType = _exp.getType();
       
        // dataType = TypeConstants.numericType;
        if (TypeResolver.isNumeric(eType) || TypeResolver.isString(eType))
        {
            _dataType.setType(TypeConstants.floatType);
View Full Code Here

   
    public boolean validate() throws SPLException
    {
        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "validate");

        TypeInfo eType = _exp.getType();
       
        // dataType = TypeConstants.numericType;
        if (TypeResolver.isNumeric(eType))
        {
            _dataType.setType(TypeConstants.doubleType);
View Full Code Here

  public boolean validate() throws SPLException
  {
    logger.entering(sourceClass, Thread.currentThread().getName() + " "
        + "validate");

    TypeInfo eType = _exp.getType();

    // dataType = TypeConstants.numericType;
    if (TypeResolver.isNumeric(eType) && !eType.getIsArray())
    {
      _dataType.copy(eType);
      logger.exiting(sourceClass, Thread.currentThread().getName() + " "
          + "validate");
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.core.TypeInfo

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.