Package com.google.gxp.compiler.base

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


                           List<Import> imports,
                           List<ThrowsDeclaration> throwsDeclarations,
                           List<Parameter> parameters,
                           List<FormalTypeParameter> formalTypeParameters,
                           Expression content) {
    Constructor constructor = Constructor.empty(pos, "<gxp:template>");
    return new Template(pos, "<gxp:template>", fqTemplateName(dottedName),
                        schema, Collections.<JavaAnnotation>emptyList(), constructor, imports,
                        Collections.<ImplementsDeclaration>emptyList(),
                        throwsDeclarations,
                        parameters, formalTypeParameters,
View Full Code Here


      AttributeMap attrMap = nodeParts.getAttributes();

      ContentType contentType = createContentType(node, DEFAULT_CONTENT_TYPE);

      List<Constructor> constructors = nodeParts.getConstructors();
      Constructor constructor = constructors.isEmpty()
          ? Constructor.empty(node) : constructors.get(0);

      if (constructors.size() > 1) {
        alertSink.add(new MoreThanOneConstructorError(constructors.get(1)));
      }
View Full Code Here

      return null;
    }

    public Void visitConstructorElement(GxpNamespace.GxpElement node) {
      output.accumulate(new Constructor(node,
                                        getJavaAnnotations(node,
                                                           JavaAnnotation.Element.CONSTRUCTOR),
                                        nodeParts.getParameters()));
      return null;
    }
View Full Code Here

      appendLine("};");
    }

    protected void appendInstance() {
      StringBuilder sb;
      Constructor constructor = template.getConstructor();
      List<Parameter> cParams = constructor.getParameters();
      SourcePosition pos = constructor.getSourcePosition();

      appendLine("//");
      appendLine("// Instantiable instance of this GXP");
      appendLine("//");
      appendCppFormalTypeParameters(true, template.getFormalTypeParameters());
View Full Code Here

      appendLine("}");
    }

    protected void appendInstance() {
      StringBuilder sb;
      Constructor constructor = template.getConstructor();
      List<Parameter> cParams = constructor.getParameters();

      appendLine();
      appendLine("/**\n"
                 + " * Instantiable instance of this GXP\n"
                 + " */");
      appendAnnotations(template.getJavaAnnotations(JavaAnnotation.Element.INSTANCE));
      sb = new StringBuilder("public static class Instance");
      appendJavaFormalTypeParameters(sb, true, template.getFormalTypeParameters());
      sb.append(" implements Interface");
      appendJavaFormalTypeParameters(sb, false, template.getFormalTypeParameters());
      sb.append(" {");
      appendLine(sb);
      for (Parameter param : cParams) {
        formatLine("private final %s %s;", toJavaType(param.getType()), param.getPrimaryName());
      }

      appendLine();
      appendAnnotations(constructor.getJavaAnnotations());
      sb = new StringBuilder("public Instance(");
      COMMA_JOINER.appendTo(sb, Iterables.transform(cParams, parameterToAnnotatedCallParameter));
      sb.append(") {");
      appendLine(sb);
      for (Parameter param : cParams) {
View Full Code Here

      AttributeMap attrMap = nodeParts.getAttributes();

      ContentType contentType = createContentType(node, DEFAULT_CONTENT_TYPE);

      List<Constructor> constructors = nodeParts.getConstructors();
      Constructor constructor = constructors.isEmpty()
          ? Constructor.empty(node) : constructors.get(0);

      if (constructors.size() > 1) {
        alertSink.add(new MoreThanOneConstructorError(constructors.get(1)));
      }
View Full Code Here

      return null;
    }

    public Void visitConstructorElement(GxpNamespace.GxpElement node) {
      output.accumulate(new Constructor(node,
                                        getJavaAnnotations(node,
                                                           JavaAnnotation.Element.CONSTRUCTOR),
                                        nodeParts.getParameters()));
      return null;
    }
View Full Code Here

      appendLine("}");
    }

    protected void appendInstance() {
      StringBuilder sb;
      Constructor constructor = template.getConstructor();
      List<Parameter> cParams = constructor.getParameters();

      appendLine();
      appendLine("/**\n"
                 + " * Instantiable instance of this GXP\n"
                 + " */");
      appendAnnotations(template.getJavaAnnotations(JavaAnnotation.Element.INSTANCE));
      sb = new StringBuilder("public static class Instance");
      appendScalaFormalTypeParameters(sb, true, template.getFormalTypeParameters());
      sb.append(" implements Interface");
      appendScalaFormalTypeParameters(sb, false, template.getFormalTypeParameters());
      sb.append(" {");
      appendLine(sb);
      for (Parameter param : cParams) {
        formatLine("private final %s %s;", toScalaType(param.getType()), param.getPrimaryName());
      }

      appendLine();
      appendAnnotations(constructor.getJavaAnnotations());
      sb = new StringBuilder("public Instance(");
      COMMA_JOINER.appendTo(sb, Iterables.transform(cParams, parameterToAnnotatedCallParameter));
      sb.append(") {");
      appendLine(sb);
      for (Parameter param : cParams) {
View Full Code Here

TOP

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

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.