Package ariba.util.fieldtype

Examples of ariba.util.fieldtype.TypeInfo


        equivalent boxed type.
    */
    private String getTypeName (TypeInfo info)
    {
        if (!PrimitiveTypeProvider.isBoxedType(info)) {
            TypeInfo boxedTypeInfo =(TypeInfo)PrimitiveTypeProvider.getBoxedTypeInfo(info);
            if (boxedTypeInfo != null) {
                return boxedTypeInfo.getName();
            }
        }
        return info.getName();
    }
View Full Code Here


                                    Node node,
                                    TypeInfo operandTypeInfo)
    {
        for (int i=0; i < operands.size(); i++) {
            Node child = (Node)operands.get(i);
            TypeInfo info = getTypeInfoForNode(child);
            if (info != null) {
                if (!operandTypeInfo.isCompatible(info) &&
                    !info.isCompatible(operandTypeInfo)) {
                    addError(node, Fmt.S(
                        "Types of operands in expression is not '%s'.",
                        operandTypeInfo.getName()));
                    break;
                }
View Full Code Here

            }

            // Get the element type of the container.   The element type is
            // the root type of the sub-expression in the projection.
            ContainerTypeInfo containerType = (ContainerTypeInfo)getCurrentTypeInfo();
            TypeInfo elementType = containerType.getElementType();
            beginLexicalScope(elementType, node);

            try {
                // Iterate through the children.
                int numOfChild = node.jjtGetNumChildren();
                TypeInfo result = null;
                for (int i=0; i < numOfChild; i++) {
                    Node child = node.jjtGetChild(i);

                    // resolve the type of this child
                    child.accept(this);
View Full Code Here

        // The child of a projection node is an expression.  The expression
        // selects the all elements in the projection list that satisifes
        // this condition.  The result of "FindAll" is ContainerTypeInfo whose
        // element type is the element type of the project list.
        if (elementType != null) {
            TypeInfo listType = getTypeInfo("java.util.ArrayList");
            ContainerTypeInfo containerType =
                new ContainerTypeInfo(listType, elementType);
            addSemanticRecordToNode(node, containerType, null,
                    Symbol.ProjectionFindAll, getFullPath(node));
        }
View Full Code Here

        // The result of "Collect" is list of evaluation results.
        Node expr = node.jjtGetChild(0);
        if (expr != null) {
            // Find out the result type of the expression
            SemanticRecord record = getSemanticRecordForNode(expr);
            TypeInfo elementType = (record != null ? record.getTypeInfo() : null);
            TypeInfo listType = getTypeInfo("java.util.ArrayList");
            if (elementType != null) {
                ContainerTypeInfo containerType =
                    new ContainerTypeInfo(listType, elementType);
                addSemanticRecordToNode(node, containerType, null,
                        Symbol.ProjectionCollect, getFullPath(node));
View Full Code Here

        }
    }

    private void handleAggregateMethod (ASTProject node)
    {
        TypeInfo operandTypeInfo = checkNumericOperands(node, true, true);
        if (operandTypeInfo != null) {
            addSemanticRecordToNode(node, operandTypeInfo, null,
                    Symbol.ProjectionAggregate, getFullPath(node));
        }
    }
View Full Code Here

        printVisitNode(node);
        try {
            Object value = node.getValue();
            if (value != null) {
                String className = value.getClass().getName();
                TypeInfo info = getTypeInfo(node, className);
                if (info != null) {
                    addSemanticRecordToNode(node, info);
                }
            }
            else {
View Full Code Here

                // property to the unresolved list.
                _unresolvedPropertyList.add(node.getName());
                return;
            }

            TypeInfo type = getCurrentTypeInfo();

            TypeInfo fieldType = getFieldTypeInfo(node, type, name);
            if (fieldType != null) {
                // This property is a known field type for the class.
                addSemanticRecordToNode(node, fieldType,
                                        getPropertyInfo(type, name),
                                        Symbol.Field,
                                        getFullPath(node));
            }
            else if (ReservedVarNames.indexOf(name) != -1) {
                // Reserved word such as "this" and "it" will be handled by
                // ASTThis and ASTIt.  If these symbols are encountered here,
                // they are embedded within the property chain.
                addError(node, Fmt.S("%s %s",
                    "Fail to find field '%s' in type '%s'.",
                    "Field '%s' is a reserved word which should be used at the beginning of a field path."));
            }
            else if (isFirstInPropertyChain(node) &&
                     (type = getTypeInfo(node, name)) != null) {
                // This symbol represents a type alias.
                addSemanticRecordToNode(node, type, null, Symbol.Type, null);
            }
            else if (isVariableSymbol(node)) {
                // This is a variable.
                SemanticRecord record = getSemanticRecordForSymbol(
                                              node.getName(), Symbol.Variable);
                if (record != null && record.getSymbolKind() == Symbol.Variable) {
                    // It is a known variable.  There is no scoping rule
                    // for variable. So for the symbol table, the latest type
                    // info of the variable takes over.
                    TypeInfo info = (record != null ? record.getTypeInfo() : null);
                    addSemanticRecordToNode(node, info, null, Symbol.Variable, null);

                    // If this varaible is associated with a constant value,
                    // then associate this node with that constant.
                    setNodeConstantValue(node, record.getNode());
                }
            }
            else if (predecessorHasConstantValue(node)) {
                // If the predecessor of this property is a map constant, then
                // this property may specify the key to lookup the map element.
                Node value = getValueFromConstantPredecessor(node);
                TypeInfo info = getTypeInfoForNodeValue(value);

                addSemanticRecordToNode(node, info, null, Symbol.Key, getFullPath(node));
                setNodeConstantValue(node, value);
            }
            else if (isInPropertyChain(node)) {
View Full Code Here

       else {
           ASTChain parent = (ASTChain)node.jjtGetParent();
           Node predecessor = parent.jjtGetChild(0);
           SemanticRecord record = getSemanticRecordForNode(predecessor);
           if (record != null) {
               TypeInfo type = record.getTypeInfo();
               if (type != null) {
                   TypeInfo mapType = getTypeInfo("java.util.Map");
                   if (mapType.isAssignableFrom(type)) {
                       return true;
                   }
               }
           }
           return predecessorHasMap(predecessor);
View Full Code Here

     * @param value
     * @return
     */
    private TypeInfo getTypeInfoForNodeValue (Node value)
    {
        TypeInfo info = null;
        if (value != null) {
            SemanticRecord record = getSemanticRecordForNode(value);
            if (record != null) {
                info = record.getTypeInfo();
            }
View Full Code Here

TOP

Related Classes of ariba.util.fieldtype.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.