Package com.google.gxp.compiler.base

Examples of com.google.gxp.compiler.base.TemplateName


      // an already bound and validated call alone.
      return call.transformParams(this);
    }

    public Expression visitUnboundCall(UnboundCall call) {
      TemplateName calleeName = call.getCallee();
      Map<String, Attribute> params = call.getAttributes();
      Callable callee = params.containsKey(Implementable.INSTANCE_PARAM_NAME)
          ? serviceDirectory.getInstanceCallable(calleeName)
          : serviceDirectory.getCallable(calleeName);
View Full Code Here


    }

    // ImplementsVisitor<ImplementsDeclaration> methods:
    public ImplementsDeclaration
    visitUnboundImplementsDeclaration(UnboundImplementsDeclaration uid) {
      TemplateName templateName = uid.getTemplateName();
      Implementable theInterface = serviceDirectory.getImplementable(templateName);

      if (theInterface == null) {
        alertSink.add(new ImplementableNotFoundError(uid, templateName));
        // suppress any other ImplementsDeclaration alerts; return 'null',
View Full Code Here

   * specified baseName with our package imports. If there is not a unique
   * callable, returns null.
   */
  private <T> TemplateName baseFindUniquePackageMatch(String baseName,
                                                      Function<TemplateName, T> underlyingGetter) {
    TemplateName result = null;
    for (String packageImport : packageImports) {
      TemplateName fqName = new TemplateName.FullyQualified(packageImport, baseName);
      if (underlyingGetter.apply(fqName) != null) {
        if (result != null) {
          // Ambiguous match.
          return null;
        } else {
View Full Code Here

      return null;
    }

    @Override
    public Void visitClassImport(ClassImport imp) {
      TemplateName className = imp.getClassName();
      String baseName = className.getBaseName();
      TemplateName redundantImport = classImports.get(baseName);
      if ((redundantImport != null) && !className.equals(redundantImport)) {
        alertSink.add(new AmbiguousImportError(imp, baseName, redundantImport, className));
      } else {
        classImports.put(baseName, className);
      }
View Full Code Here

  public Interface iface(SourcePosition pos, String dottedName, Schema schema,
                         List<Import> imports,
                         List<ThrowsDeclaration> throwsDeclarations,
                         List<Parameter> parameters,
                         List<FormalTypeParameter> formalTypeParameters) {
    TemplateName name = fqTemplateName(dottedName);
    List<Parameter> params = Lists.newArrayList(parameters);
    params.add(new Parameter(new FormalParameter(pos,
                                                 Implementable.INSTANCE_PARAM_NAME,
                                                 Implementable.INSTANCE_PARAM_NAME,
                                                 new TemplateType(pos, name.toString(), name))));

    return new Interface(pos, "<gxp:interface>", fqTemplateName(dottedName),
                         schema, Collections.<JavaAnnotation>emptyList(), imports,
                         throwsDeclarations, params, formalTypeParameters);
  }
View Full Code Here

    }

    // TODO(harryh): factor common code to base class
    @Override
    protected void appendClass() {
      TemplateName templateName = template.getName();
      appendAnnotations(template.getJavaAnnotations(JavaAnnotation.Element.CLASS));
      formatLine(template.getSourcePosition(), "public class %s extends %s {",
                 getClassName(templateName), getBaseClassName());
      appendStaticContent();
      appendWriteMethod();
View Full Code Here

      super(out, alertSink, iface);
      this.extraIncludess = ImmutableSet.copyOf(extraIncludess);
    }

    protected void appendClass() {
      TemplateName ifaceName = iface.getName();

      appendIfdefGuardStart(iface);
      appendLine();
      appendLine("#include \"gxp/base/base.h\"");
      appendImports(iface, extraIncludess);
View Full Code Here

      this.extraIncludess = ImmutableSet.copyOf(extraIncludess);
    }

    protected void appendClass() {
      SourcePosition pos = template.getSourcePosition();
      TemplateName templateName = template.getName();

      appendIfdefGuardStart(template);
      appendLine();
      appendLine("#include \"gxp/base/base.h\"");
      appendImports(template, extraIncludess);
View Full Code Here

        NativeType type = new NativeType(node, interfaceType);
        output.accumulate(new NativeImplementsDeclaration(node, type));
      } else {
        interfaceType = attrMap.get("interface", null);
        if (interfaceType != null) {
          TemplateName templateName = TemplateName.create(null, interfaceType);
          output.accumulate(new UnboundImplementsDeclaration(node, templateName));
        }
      }
      return null;
    }
View Full Code Here

    public Void visitThrowsElement(GxpNamespace.GxpElement node) {
      AttributeMap attrMap = nodeParts.getAttributes();
      String exceptionType = attrMap.get("exception", null);
      if (exceptionType != null) {
        TemplateName exception =
            TemplateName.parseDottedName(
                alertSink, node.getSourcePosition(), exceptionType);
        if (exception != null) {
          // TODO(harryh): exceptionType should be a NativeType, not just
          //               a String
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.base.TemplateName

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.