Package ariba.util.fieldtype

Examples of ariba.util.fieldtype.TypeInfo


        return result;
    }

    private void registerMethodReturnType (Node node, MethodInfo method)
    {
        TypeInfo returnType = method.getReturnType(_env.getTypeRetriever());
        if (returnType != null) {
            addSemanticRecordToNode(node, returnType, method,
                                    Symbol.Method,
                                    getFullPath(node));
        }
View Full Code Here


    protected void doVisit (ASTCast node)
    {
        printVisitNode(node);

        TypeInfo actualType = null;

        Node child = node.jjtGetChild(0);
        SemanticRecord record = getSemanticRecordForNode(child);
        if (record != null) {
            actualType = record.getTypeInfo();
        }

        TypeInfo castTo = castTo(node, actualType);
        addSemanticRecordToNode(node, castTo, null, null, null);
    }
View Full Code Here

            addError(node,
                    Fmt.S("Class name is missing in cast operation."));
            return actualType;
        }

        TypeInfo castToType = _env.getTypeRetriever().getTypeInfo(castTo);
        if (castToType == null) {
            addError(node,
                    Fmt.S("Cannot resolve string '%s' to a type.", castTo));
            return actualType;
        }
        else if (actualType == null) {
            // If the acutal type is null, then there must be an error
            // added to already.  Just return the castTo type to continue
            // on the type checking.
            return castToType;
        }
        else  if (actualType.isCompatible(castToType)) {
            // isCompatible() returns true if actualType can be widened or
            // narrowed to the castToType.
            return castToType;
        }
        else {
            addError(node,
                    Fmt.S("Cannot cast '%s' to '%s' since they are not compatible.",
                            actualType.getName(), castToType.getName()));
            // An error is already logged.  Return the castTo type so we can
            // continue on the type checking.
            return castToType;
        }
    }
View Full Code Here

        try {
            int numOfChild = node.jjtGetNumChildren();
            Node lastChild = node.jjtGetChild(numOfChild-1);
            SemanticRecord record = getSemanticRecordForNode(lastChild);
            if (record != null) {
                TypeInfo result = record.getTypeInfo();
                addSemanticRecordToNode(node, result);
            }
            else {
                if  (hasRootType()) {
                    addError(node,
View Full Code Here

                _unresolvedPropertyList.clear();
                _firstUnresolvedProperty = null;
            }

            int numOfChild = node.jjtGetNumChildren();
            TypeInfo result = null;
            Node lastChild = null;
            for (int i=0; i < numOfChild; i++) {
                lastChild = node.jjtGetChild(i);

                // resolve the type of this child
View Full Code Here

    protected void doVisit (ASTList node)
    {
        printVisitNode(node);
        try {
            TypeInfo childInfo = checkCompatibleOperands(node, false);
            ContainerTypeInfo listInfo =
                (ContainerTypeInfo)getTypeInfo(node, List.class.getName());
            if (childInfo != null) {
                listInfo.setElementTypeInfo(childInfo);
            }
View Full Code Here

            int numOfChild = node.jjtGetNumChildren();
            if (numOfChild > 1) {
                Node child = node.jjtGetChild(1);
                SemanticRecord record = getSemanticRecordForNode(child);
                if (record != null) {
                    TypeInfo result = record.getTypeInfo();
                    addSemanticRecordToNode(node, result);
                }
                else {
                    if (hasRootType()) {
                        addError(node,
View Full Code Here

        for (int i=0; i < node.jjtGetNumChildren(); i++) {
            Node child = node.jjtGetChild(i);
            if (i > 0) {
                buffer.append(", ");
            }
            TypeInfo type = child.getTypeInfo();
            // Just print the arugment type without the argument name.  The
            // argument name can be an expression and it would be hard to read.
            buffer.append(type != null ? type.getName() : "<type unknown>");
        }
        buffer.append(")");

        return buffer.toString();
    }
View Full Code Here

      }

      public static int getNumericTypeForName (String typeName)
      {
          TypeProvider tp = PrimitiveTypeProvider.instance();
          TypeInfo ti = PrimitiveTypeProvider.getBoxedTypeInfo(tp.getTypeInfo(typeName));
          if (ti != null) {
              typeName = ti.getName();
          }

          if (typeName != null) {
              if (typeName.equals(Integer.class.getName())) {
                  return INT;
View Full Code Here

    }

    protected Object getValueBody( ExprContext context, Object source ) throws ExprException
    {
        Object result = children[0].getValue( context, source );
        TypeInfo resultInfo = children[0].getTypeInfo();
        if (resultInfo == null || resultInfo instanceof NullTypeInfo) {
            resultInfo = getTypeInfo();
        }
        String resultType = resultInfo != null? resultInfo.getName(): null;
        for ( int i=1; i < children.length; ++i ) {
          TypeInfo info = children[i].getTypeInfo();
            result = ExprOps.multiply(
                result,
                children[i].getValue(context, source),
                resultType,
                  info != null? info.getName(): null);
            resultType = result != null? result.getClass().getName(): null;
        }
        return result;
    }
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.