Package com.google.gxp.compiler.schema

Examples of com.google.gxp.compiler.schema.Schema


            public Void visitBundleType(BundleType type) {
              final AttributeValidator validator = type.getValidator(name);
              String innerContentTypeString = validator.getContentType();
              if (innerContentTypeString != null) {
                Schema innerSchema = schemaFactory.fromContentTypeName(innerContentTypeString);
                attrBundles.get(parameter.getPrimaryName()).put(validator,
                                                         updatedAttr.withInnerSchema(innerSchema));
              } else {
                attrBundles.get(parameter.getPrimaryName()).put(validator, updatedAttr);
              }
View Full Code Here


    Visitor(AlertSink alertSink) {
      this.alertSink = Preconditions.checkNotNull(alertSink);
    }

    private Expression flattenDocType(OutputElement element, DocType docType) {
      Schema elementSchema = element.getSchema();
      Expression xmlDoctype =
          new StringConstant(element, elementSchema,
                             docType.toXml(element.getLocalName()));

      Expression sgmlDoctype;
View Full Code Here

                             new IsXmlExpression(element, elementSchema),
                             xmlDoctype, sgmlDoctype);
    }

    private Expression flattenXmlns(OutputElement element) {
      Schema elementSchema = element.getSchema();
      String xmlns = elementSchema.getNamespaceUri();

      List<Expression> concatList = Lists.newArrayList();
      concatList.add(new StringConstant(element, elementSchema, " xmlns"));
      if (elementSchema.getTagPrefix() != null) {
        concatList.add(new StringConstant(element, elementSchema, ":"));
        concatList.add(new StringConstant(element, elementSchema,
                                          elementSchema.getTagPrefix()));
      }
      concatList.add(new StringConstant(element, elementSchema, "=\""));
      concatList.add(new StringConstant(element, elementSchema,
          CharEscapers.xmlEscaper().escape(xmlns)));
      concatList.add(new StringConstant(element, elementSchema, "\""));
View Full Code Here

    @Override
    public Expression visitOutputElement(OutputElement element) {
      List<Expression> values = Lists.newArrayList();
      ElementValidator elementValidator = element.getValidator();
      Schema elementSchema = element.getSchema();
      String tagPrefix = elementSchema.getTagPrefix();
      DocType docType = element.getDocType();
      if (docType != null) {
        values.add(flattenDocType(element, docType));
      }
      values.add(new StringConstant(element, elementSchema, "<"));
View Full Code Here

    /**
     * Constructs an Expression to output a boolean attribute.
     * Example: selected="selected" if in XML mode else selected
     */
    private Expression buildBooleanAttrExpression(Attribute attr, OutputElement element) {
      Schema elementSchema = element.getSchema();
      List<Expression> values = Lists.newArrayList();

      values.add(new StringConstant(attr, elementSchema," " + attr.getName()));
      values.add(new Conditional(
                     attr, elementSchema,
View Full Code Here

    assertEquals(value, result.evaluate());
  }

  public void testEscape() throws Exception {
    Expression subexpression = expr("\"foo < bar\"");
    Schema schema = htmlSchema();

    EscapeExpression result =
        (EscapeExpression) escape(schema, subexpression);

    assertEquals(subexpression, result.getSubexpression());
View Full Code Here

      if (phName == null) {
        return expr;
      }

      Schema exprSchema = expr.getSchema();
      List<Expression> values = Lists.newArrayList();

      values.add(new PlaceholderStart(expr, exprSchema, phName, null));
      values.add(expr);
      values.add(new PlaceholderEnd(expr, exprSchema));
View Full Code Here

      String phName = element.getPhName();
      if (phName == null) {
        return super.visitOutputElement(element);
      }

      Schema elementSchema = element.getSchema();
      boolean whitespaceContent = element.getContent().alwaysOnlyWhitespace();
      List<Expression> values = Lists.newArrayList();

      String name = whitespaceContent ? phName : phName + "_start";
      values.add(new PlaceholderStart(element, elementSchema, name, null));
View Full Code Here

      } else {
        node = attr;
        contentType = attr.getValue().getStaticString(alertSink, defaultValue);
      }

      Schema schema = (contentType == null)
          ? null
          : schemaFactory.fromContentTypeName(contentType);

      if (schema == null && contentType != null) {
        alertSink.add(new UnknownContentTypeError(node, contentType));
View Full Code Here

      boolean hidden = attrMap.getBooleanValue("hidden");
      // TODO(laurence): coerce content to HTML
      Expression content = getCollapsableContent(attrMap);

      ContentType contentType = createContentType(node, null);
      Schema schema = (contentType == null) ? null : contentType.getSchema();

      output.accumulate(
          new UnextractedMessage(node, schema, name, meaning, comment, hidden, content));
      return null;
    }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.schema.Schema

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.