Package com.google.gwt.dev.jjs.ast

Examples of com.google.gwt.dev.jjs.ast.JCastOperation


      }
      if (!program.isJavaScriptObject(arg.getType())) {
        return arg;
      }
      // Synthesize a cast to the target type
      JCastOperation cast = new JCastOperation(program, arg.getSourceInfo(),
          targetType, arg);
      return cast;
    }
View Full Code Here


          // Synthesize ((EntryPoint)GWT.create(FooEntryPoint.class)).onModuleLoad();
          JClassLiteral entryPointTypeClassLiteral =
              new JClassLiteral(origin, specificEntryPointType);
          JMethodCall createInstanceCall =
              new JMethodCall(origin, null, gwtCreateMethod, entryPointTypeClassLiteral);
          JCastOperation castToEntryPoint =
              new JCastOperation(origin, entryPointType, createInstanceCall);
          JMethodCall instanceOnModuleLoadCall =
              new JMethodCall(origin, castToEntryPoint, onModuleLoadMethod);
          initMethodBlock.addStmt(instanceOnModuleLoadCall.makeStatement());
        }
      }
View Full Code Here

    }

    JExpression processExpression(CastExpression x) {
      SourceInfo info = makeSourceInfo(x);
      JType type = (JType) typeMap.get(x.resolvedType);
      JCastOperation cast = new JCastOperation(info, type,
          dispProcessExpression(x.expression));
      return cast;
    }
View Full Code Here

    private JExpression maybeCast(JType expected, JExpression expression) {
      if (expected != expression.getType()) {
        // Must be a generic; insert a cast operation.
        JReferenceType toType = (JReferenceType) expected;
        return new JCastOperation(expression.getSourceInfo(), toType,
            expression);
      } else {
        return expression;
      }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.jjs.ast.JCastOperation

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.