Package com.google.caja.parser.js

Examples of com.google.caja.parser.js.Block.appendChild()


    assertTrue(n.children().get(0).isImmutable());
    assertTrue(n.children().get(0).children().get(0).isImmutable());
    assertTrue(n.children().get(1).isImmutable());
    assertTrue(n.children().get(1).children().get(0).isImmutable());
    try {
      n.appendChild(new Noop(FilePosition.UNKNOWN));
      fail();
    } catch (UnsupportedOperationException e) { /* OK */ }
    try {
      n.setComments(Arrays.asList(
          Token.instance("test", JsTokenType.COMMENT, FilePosition.UNKNOWN)));
View Full Code Here


    Map<ElKey, String> einterfaces = elementDOMInterfaces(schema);
    Map<AttribKey, UriEffect> uriEffects = uriEffects(schema);
    Map<AttribKey, LoaderType> ltypes = loaderTypes(schema);

    Block definitions = new Block();
    definitions.appendChild(QuasiBuilder.substV("var html4 = {};"));

    definitions.appendChild(mapFromEnum(
        EnumSet.allOf(HTML.Attribute.Type.class),
        "atype",
        new Function<HTML.Attribute.Type, String>() {
View Full Code Here

    Map<AttribKey, LoaderType> ltypes = loaderTypes(schema);

    Block definitions = new Block();
    definitions.appendChild(QuasiBuilder.substV("var html4 = {};"));

    definitions.appendChild(mapFromEnum(
        EnumSet.allOf(HTML.Attribute.Type.class),
        "atype",
        new Function<HTML.Attribute.Type, String>() {
          public String apply(HTML.Attribute.Type f) {
            return f.name();
View Full Code Here

            || SCRIPT_SRC.equals(key)) {
          keys.add(StringLiteral.valueOf(unk, key.toString()));
          values.add(new IntegerLiteral(unk, A_TYPE_MAP.get(e.getValue())));
        }
      }
      definitions.appendChild(export("ATTRIBS",
          (Expression) QuasiBuilder.substV(
              "({ @k*: @v* })",
              "k", new ParseTreeNodeContainer(keys),
              "v", new ParseTreeNodeContainer(values))));
    }
View Full Code Here

              "({ @k*: @v* })",
              "k", new ParseTreeNodeContainer(keys),
              "v", new ParseTreeNodeContainer(values))));
    }

    definitions.appendChild(mapFromEnum(
        EnumSet.allOf(EFlag.class),
        "eflags",
        new Function<EFlag, String>() {
          public String apply(EFlag f) {
            return f.name();
View Full Code Here

            return f.bitMask;
          }
        })
    );

    definitions.appendChild(mapFromMap(
        eflags,
        "ELEMENTS",
        new Function<EnumSet<EFlag>, Expression>() {
          public Expression apply(EnumSet<EFlag> flags) {
            int value = 0;
View Full Code Here

            return new IntegerLiteral(unk, value);
          }
        })
    );

    definitions.appendChild(mapFromMap(
        einterfaces,
        "ELEMENT_DOM_INTERFACES",
        new Function<String, Expression>() {
          public Expression apply(String domInterface) {
            return new StringLiteral(unk, domInterface);
View Full Code Here

            return new StringLiteral(unk, domInterface);
          }
        })
    );

    definitions.appendChild(mapFromEnum(
        EnumSet.allOf(UriEffect.class),
        "ueffects",
        new Function<UriEffect, String>() {
          public String apply(UriEffect f) {
            return f.name();
View Full Code Here

            return A_UEFFECT_MAP.get(f);
          }
        })
    );

    definitions.appendChild(mapFromEnum(
        uriEffects.entrySet(),
        "URIEFFECTS",
        new Function<Entry<AttribKey, UriEffect>, String>() {
          public String apply(Entry<AttribKey, UriEffect> f) {
            return f.getKey().toString();
View Full Code Here

            return A_UEFFECT_MAP.get(f.getValue());
          }
        })
    );

    definitions.appendChild(mapFromEnum(
        EnumSet.allOf(LoaderType.class),
        "ltypes",
        new Function<LoaderType, String>() {
          public String apply(LoaderType f) {
            return f.name();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.