Examples of PropertySymbol


Examples of org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol

        }
        boolean isPropertyOfClass = true;
        boolean isKey = false;

        // create a new property symbol object
        Symbol s = new PropertySymbol(f.getName(), internalType,
            referenceTypeName, isArray, isKey, isPropertyOfClass);

        // insert into map
        // xiping's test 06/19/09
        // a Java class field name must be unique
View Full Code Here

Examples of org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol

      if(logger.isLoggable(Level.FINE))
        logger.fine(Thread.currentThread().getName()+ "constant expression "+e.toString());
            Object result = e.evaluate();
      String constantSymbol = cd.getIdent();
      // xiping's modification, 06/23/09
      PropertySymbol constantSym = (PropertySymbol)symTab.getSymbol(constantSymbol);
//      Collection c = symTab.getSymbol(constantSymbol);
//      Iterator it = c.iterator();
//      PropertySymbol constantSym = (PropertySymbol)it.next();
            if(logger.isLoggable(Level.FINE))
                logger.fine(Thread.currentThread().getName()+"constantSym name"+ constantSym.getName()+" current value:"+constantSym.getValue()+" setting value to:"+result.toString());
           
            constantSym.setValue(result);
    }

        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
  
  }
View Full Code Here

Examples of org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol

        }
        boolean isArray = CIMSPLTypeConstants.getIsArray(cimproperty.getType().getType());

        if(logger.isLoggable(Level.FINE))
          logger.fine(Thread.currentThread().getName()+" symboltable does not currently contain the given property, so creating property symbol");
        Symbol symbol = new PropertySymbol(qualifiedPropertyName,type,referenceTypeName,isArray,_isKey(cimproperty),true);
        //add property to properties list
        if(logger.isLoggable(Level.FINE))
          logger.fine(Thread.currentThread().getName()+" adding property to Map in datacollector : "+qualifiedPropertyName);
        symbols.put(qualifiedPropertyName, symbol);
View Full Code Here

Examples of org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol

          String qualifiedPropertyNm=methodOrParam;                                                                // the symbol
          if(!targetName.equalsIgnoreCase(""))   
          {
            qualifiedPropertyNm=targetName+"."+methodOrParam;
          }
          PropertySymbol prop = (PropertySymbol) symTab.getSymbol( qualifiedPropertyNm); // extract
          result = prop.getValue(); // get its value
          if (prop.isArray())
          {
            this._dataType.setIsArray(true);
          }
          else
          {
View Full Code Here

Examples of org.apache.imperius.spl.parser.compiler.symboltable.PropertySymbol

          // sym instanceof PropertySymbol
          {
            // System.out.println("sym instanceof PropertySymbol");
            // //System.out.println("propType "+propType.getType());

            PropertySymbol pSym = (PropertySymbol) sym;
            if (pSym.isArray())
            {
              array2Exists = true;
              // System.out.println("pSym.isArray()");
              _dataType.setIsArray(false);
View Full Code Here

Examples of org.datanucleus.query.symbol.PropertySymbol

            // Load subqueries into symbol table so the compilation knows about them
            Iterator<String> subqueryIter = subqueryMap.keySet().iterator();
            while (subqueryIter.hasNext())
            {
                String subqueryName = subqueryIter.next();
                Symbol sym = new PropertySymbol(subqueryName);
                sym.setType(Symbol.VARIABLE);
                symtbl.addSymbol(sym);
            }
        }

        Expression[] exprFrom = compileFrom();
View Full Code Here

Examples of org.datanucleus.query.symbol.PropertySymbol

            // Load subqueries into symbol table so the compilation knows about them
            Iterator<String> subqueryIter = subqueryMap.keySet().iterator();
            while (subqueryIter.hasNext())
            {
                String subqueryName = subqueryIter.next();
                Symbol sym = new PropertySymbol(subqueryName);
                sym.setType(Symbol.VARIABLE);
                symtbl.addSymbol(sym);
            }
        }

        Expression[] exprFrom = compileFrom();
View Full Code Here

Examples of org.datanucleus.query.symbol.PropertySymbol

        {
            // Try with our symbol table
            try
            {
                Class symbolType = symtbl.getType(tuples);
                symbol = new PropertySymbol(getId(), symbolType);
            }
            catch (NucleusUserException nue)
            {
                // Thrown if a field in the primary expression doesn't exist.
            }
        }

        if (symbol == null && symtbl.getParentSymbolTable() != null)
        {
            // Try parent symbol table if present
            try
            {
                Class symbolType = symtbl.getParentSymbolTable().getType(tuples);
                symbol = new PropertySymbol(getId(), symbolType);
            }
            catch (NucleusUserException nue)
            {
                // Thrown if a field in the primary expression doesn't exist.
            }
View Full Code Here

Examples of org.datanucleus.query.symbol.PropertySymbol

                    }
                }
                if (symtbl.getSymbol(classAlias) == null)
                {
                    // Add symbol for this candidate under its alias
                    symtbl.addSymbol(new PropertySymbol(classAlias, cls));
                }
            }

            Iterator childIter = node[i].getChildNodes().iterator();
            while (childIter.hasNext())
            {
                // Add entries in symbol table for any joined aliases
                Node childNode = (Node)childIter.next();
                if (childNode.getNodeType() == NodeType.OPERATOR)
                {
                    Node joinedNode = childNode.getFirstChild();
                    String joinedAlias = (String)joinedNode.getNodeValue();
                    Symbol joinedSym =
                        (caseSensitiveAliases ? symtbl.getSymbol(joinedAlias) : symtbl.getSymbolIgnoreCase(joinedAlias));
                    if (joinedSym == null)
                    {
                        throw new QueryCompilerSyntaxException("FROM clause has identifier " + joinedNode.getNodeValue() + " but this is unknown");
                    }
                    AbstractClassMetaData joinedCmd = metaDataManager.getMetaDataForClass(joinedSym.getValueType(), clr);
                    Class joinedCls = joinedSym.getValueType();
                    while (joinedNode.getFirstChild() != null)
                    {
                        joinedNode = joinedNode.getFirstChild();
                        String joinedMember = (String)joinedNode.getNodeValue();
                        AbstractMemberMetaData mmd = joinedCmd.getMetaDataForMember(joinedMember);
                        if (mmd == null)
                        {
                            throw new QueryCompilerSyntaxException("FROM clause has reference to " + joinedCmd.getFullClassName() + "." + joinedMember + " but it doesn't exist!");
                        }

                        int relationType = mmd.getRelationType(clr);
                        switch (relationType)
                        {
                            case Relation.ONE_TO_ONE_UNI:
                            case Relation.ONE_TO_ONE_BI:
                            case Relation.MANY_TO_ONE_BI:
                                joinedCls = mmd.getType();
                                joinedCmd = metaDataManager.getMetaDataForClass(joinedCls, clr);
                                break;
                            case Relation.ONE_TO_MANY_UNI:
                            case Relation.ONE_TO_MANY_BI:
                            case Relation.MANY_TO_MANY_BI:
                                if (mmd.hasCollection())
                                {
                                    // TODO Don't currently allow interface field navigation
                                    joinedCmd = mmd.getCollection().getElementClassMetaData(clr, metaDataManager);
                                    joinedCls = clr.classForName(joinedCmd.getFullClassName());
                                }
                                else if (mmd.hasArray())
                                {
                                    // TODO Don't currently allow interface field navigation
                                    joinedCmd = mmd.getArray().getElementClassMetaData(clr, metaDataManager);
                                    joinedCls = clr.classForName(joinedCmd.getFullClassName());
                                }
                                break;
                            default:
                                break;
                        }
                    }

                    Node aliasNode = childNode.getNextChild();
                    if (aliasNode.getNodeType() == NodeType.NAME)
                    {
                        symtbl.addSymbol(new PropertySymbol((String)aliasNode.getNodeValue(), joinedCls));
                    }
                }
            }

            boolean classIsExpression = false;
View Full Code Here

Examples of org.datanucleus.query.symbol.PropertySymbol

            if (parentCompiler != null && parentCompiler.candidateAlias.equals(candidateAlias))
            {
                candidateAliasOrig = candidateAlias;
                candidateAlias = "sub_" + candidateAlias;
            }
            PropertySymbol symbol = new PropertySymbol(candidateAlias, candidateClass);
            symtbl.addSymbol(symbol);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.